@wise/dynamic-flow-client 0.4.0 → 0.4.1
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 +3 -2
- package/build/common/constants/DateMode.js.map +1 -0
- package/build/common/constants/FormControlType.js +3 -2
- package/build/common/constants/FormControlType.js.map +1 -0
- package/build/common/constants/MonthFormat.js +3 -2
- package/build/common/constants/MonthFormat.js.map +1 -0
- package/build/common/constants/SchemaType.js +3 -2
- package/build/common/constants/SchemaType.js.map +1 -0
- package/build/common/constants/Size.js +3 -2
- package/build/common/constants/Size.js.map +1 -0
- package/build/common/constants/index.js +2 -1
- package/build/common/constants/index.js.map +1 -0
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +16 -27
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js.map +1 -0
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +12 -9
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js.map +1 -0
- package/build/common/contexts/eventsContext/EventsContext.js +12 -28
- package/build/common/contexts/eventsContext/EventsContext.js.map +1 -0
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +15 -27
- package/build/common/contexts/fetcherContexts/FetcherContexts.js.map +1 -0
- package/build/common/contexts/index.js +2 -1
- package/build/common/contexts/index.js.map +1 -0
- package/build/common/contexts/logContext/LogContext.js +13 -30
- package/build/common/contexts/logContext/LogContext.js.map +1 -0
- package/build/common/hooks/index.js +2 -1
- package/build/common/hooks/index.js.map +1 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +4 -3
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js.map +1 -0
- package/build/common/hooks/useExternal/useExternal.js +9 -8
- package/build/common/hooks/useExternal/useExternal.js.map +1 -0
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +21 -31
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js.map +1 -0
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +61 -139
- package/build/common/hooks/usePersistAsync/usePersistAsync.js.map +1 -0
- package/build/common/hooks/usePolling/usePolling.js +21 -21
- package/build/common/hooks/usePolling/usePolling.js.map +1 -0
- package/build/common/hooks/usePrevious/usePrevious.js +6 -5
- package/build/common/hooks/usePrevious/usePrevious.js.map +1 -0
- package/build/common/hooks/useStepPolling/useStepPolling.js +16 -14
- package/build/common/hooks/useStepPolling/useStepPolling.js.map +1 -0
- package/build/common/makeFetcher/index.js +2 -1
- package/build/common/makeFetcher/index.js.map +1 -0
- package/build/common/makeFetcher/makeFetcher.js +11 -24
- package/build/common/makeFetcher/makeFetcher.js.map +1 -0
- package/build/common/messages.js +6 -5
- package/build/common/messages.js.map +1 -0
- package/build/common/utils/api-utils.js +4 -4
- package/build/common/utils/api-utils.js.map +1 -0
- package/build/common/utils/date-utils.js +12 -11
- package/build/common/utils/date-utils.js.map +1 -0
- package/build/common/utils/debounce.js +12 -15
- package/build/common/utils/debounce.js.map +1 -0
- package/build/common/utils/file-utils.js +13 -25
- package/build/common/utils/file-utils.js.map +1 -0
- package/build/common/utils/id-utils.js +5 -5
- package/build/common/utils/id-utils.js.map +1 -0
- package/build/common/utils/index.js +2 -1
- package/build/common/utils/index.js.map +1 -0
- package/build/common/utils/is-equal.js +9 -8
- package/build/common/utils/is-equal.js.map +1 -0
- package/build/common/utils/schema-utils.js +7 -6
- package/build/common/utils/schema-utils.js.map +1 -0
- package/build/common/utils/step-utils.js +15 -14
- package/build/common/utils/step-utils.js.map +1 -0
- package/build/common/validators/index.js +8 -7
- package/build/common/validators/index.js.map +1 -0
- package/build/common/validators/models/model-validators.js +9 -8
- package/build/common/validators/models/model-validators.js.map +1 -0
- package/build/common/validators/models/models.utils.js +30 -42
- package/build/common/validators/models/models.utils.js.map +1 -0
- package/build/common/validators/schemas/schema-validators.js +12 -13
- package/build/common/validators/schemas/schema-validators.js.map +1 -0
- package/build/common/validators/types/type-validators.js +10 -13
- package/build/common/validators/types/type-validators.js.map +1 -0
- package/build/common/validators/validationFailures/validation-failures.js +15 -14
- package/build/common/validators/validationFailures/validation-failures.js.map +1 -0
- package/build/common/validators/validationFailures/validation-failures.utils.js +6 -7
- package/build/common/validators/validationFailures/validation-failures.utils.js.map +1 -0
- package/build/common/validators/values/value-validators.js +5 -6
- package/build/common/validators/values/value-validators.js.map +1 -0
- package/build/dynamicFlow/DynamicFlow.js +186 -307
- package/build/dynamicFlow/DynamicFlow.js.map +1 -0
- package/build/dynamicFlow/DynamicFlowStep.js +13 -23
- package/build/dynamicFlow/DynamicFlowStep.js.map +1 -0
- package/build/dynamicFlow/DynamicFlowTypes.js +2 -1
- package/build/dynamicFlow/DynamicFlowTypes.js.map +1 -0
- package/build/dynamicFlow/index.js +7 -14
- package/build/dynamicFlow/index.js.map +1 -0
- package/build/dynamicFlow/stories/DynamicFlow.story.js +21 -20
- package/build/dynamicFlow/stories/DynamicFlow.story.js.map +1 -0
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +21 -33
- package/build/dynamicFlow/stories/EditableDynamicFlow.js.map +1 -0
- package/build/dynamicFlow/stories/fixtureFetcher.js +47 -104
- package/build/dynamicFlow/stories/fixtureFetcher.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +23 -40
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +7 -6
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +11 -11
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js.map +1 -0
- package/build/dynamicFlow/utils/index.js +6 -2
- package/build/dynamicFlow/utils/index.js.map +1 -0
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +54 -118
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js.map +1 -0
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +10 -9
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js.map +1 -0
- package/build/dynamicFlow/utils/useDynamicFlowState.js +52 -74
- package/build/dynamicFlow/utils/useDynamicFlowState.js.map +1 -0
- package/build/dynamicFlow/utils/useLoader.js +10 -20
- package/build/dynamicFlow/utils/useLoader.js.map +1 -0
- package/build/fixtures/components/alert.js +9 -8
- package/build/fixtures/components/alert.js.map +1 -0
- package/build/fixtures/components/box.js +8 -7
- package/build/fixtures/components/box.js.map +1 -0
- package/build/fixtures/components/button.js +26 -36
- package/build/fixtures/components/button.js.map +1 -0
- package/build/fixtures/components/columns.js +11 -10
- package/build/fixtures/components/columns.js.map +1 -0
- package/build/fixtures/components/copyable.js +7 -6
- package/build/fixtures/components/copyable.js.map +1 -0
- package/build/fixtures/components/decision.js +16 -15
- package/build/fixtures/components/decision.js.map +1 -0
- package/build/fixtures/components/heading.js +8 -7
- package/build/fixtures/components/heading.js.map +1 -0
- package/build/fixtures/components/image.js +11 -10
- package/build/fixtures/components/image.js.map +1 -0
- package/build/fixtures/components/index.js +18 -25
- package/build/fixtures/components/index.js.map +1 -0
- package/build/fixtures/components/info.js +23 -6
- package/build/fixtures/components/info.js.map +1 -0
- package/build/fixtures/components/list.js +9 -8
- package/build/fixtures/components/list.js.map +1 -0
- package/build/fixtures/components/loading-indicator.js +6 -5
- package/build/fixtures/components/loading-indicator.js.map +1 -0
- package/build/fixtures/components/paragraph.js +10 -9
- package/build/fixtures/components/paragraph.js.map +1 -0
- package/build/fixtures/components/review.js +12 -11
- package/build/fixtures/components/review.js.map +1 -0
- package/build/fixtures/examples/camera-capture.js +30 -29
- package/build/fixtures/examples/camera-capture.js.map +1 -0
- package/build/fixtures/examples/index.js +10 -17
- package/build/fixtures/examples/index.js.map +1 -0
- package/build/fixtures/examples/recipient-update.js +70 -69
- package/build/fixtures/examples/recipient-update.js.map +1 -0
- package/build/fixtures/examples/recipient.js +64 -63
- package/build/fixtures/examples/recipient.js.map +1 -0
- package/build/fixtures/examples/single-file-upload.js +22 -21
- package/build/fixtures/examples/single-file-upload.js.map +1 -0
- package/build/fixtures/examples/step-validation-errors.js +22 -21
- package/build/fixtures/examples/step-validation-errors.js.map +1 -0
- package/build/fixtures/features/action-response.js +9 -8
- package/build/fixtures/features/action-response.js.map +1 -0
- package/build/fixtures/features/external.js +9 -8
- package/build/fixtures/features/external.js.map +1 -0
- package/build/fixtures/features/index.js +10 -17
- package/build/fixtures/features/index.js.map +1 -0
- package/build/fixtures/features/persist-async.js +12 -11
- package/build/fixtures/features/persist-async.js.map +1 -0
- package/build/fixtures/features/polling.js +10 -9
- package/build/fixtures/features/polling.js.map +1 -0
- package/build/fixtures/features/validation-async.js +11 -10
- package/build/fixtures/features/validation-async.js.map +1 -0
- package/build/fixtures/index.js +12 -22
- package/build/fixtures/index.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/allOf.js +31 -30
- package/build/fixtures/jsonSchemaForm/allOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/audRecipient.js +272 -271
- package/build/fixtures/jsonSchemaForm/audRecipient.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/currency.js +13 -12
- package/build/fixtures/jsonSchemaForm/currency.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +12 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +12 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/oneOf.js +28 -27
- package/build/fixtures/jsonSchemaForm/oneOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +17 -16
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +18 -17
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +31 -30
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/simple.js +17 -16
- package/build/fixtures/jsonSchemaForm/simple.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +20 -19
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.js +9 -8
- package/build/fixtures/jsonSchemaForm/validationAsync.js.map +1 -0
- package/build/fixtures/layouts/all.js +38 -37
- package/build/fixtures/layouts/all.js.map +1 -0
- package/build/fixtures/layouts/final-step-layout.js +10 -9
- package/build/fixtures/layouts/final-step-layout.js.map +1 -0
- package/build/fixtures/layouts/index.js +11 -18
- package/build/fixtures/layouts/index.js.map +1 -0
- package/build/fixtures/layouts/list.js +11 -10
- package/build/fixtures/layouts/list.js.map +1 -0
- package/build/fixtures/layouts/pay-in.js +24 -23
- package/build/fixtures/layouts/pay-in.js.map +1 -0
- package/build/fixtures/layouts/review.js +39 -38
- package/build/fixtures/layouts/review.js.map +1 -0
- package/build/fixtures/layouts/success.js +16 -15
- package/build/fixtures/layouts/success.js.map +1 -0
- package/build/fixtures/responses/action-response-final.js +9 -8
- package/build/fixtures/responses/action-response-final.js.map +1 -0
- package/build/fixtures/responses/action.js +4 -3
- package/build/fixtures/responses/action.js.map +1 -0
- package/build/fixtures/responses/exit.js +4 -3
- package/build/fixtures/responses/exit.js.map +1 -0
- package/build/fixtures/responses/index.js +9 -16
- package/build/fixtures/responses/index.js.map +1 -0
- package/build/fixtures/responses/recipient-update-final.js +9 -8
- package/build/fixtures/responses/recipient-update-final.js.map +1 -0
- package/build/fixtures/schemas/basic-form.js +12 -11
- package/build/fixtures/schemas/basic-form.js.map +1 -0
- package/build/fixtures/schemas/index.js +9 -16
- package/build/fixtures/schemas/index.js.map +1 -0
- package/build/fixtures/schemas/number-and-integer.js +12 -11
- package/build/fixtures/schemas/number-and-integer.js.map +1 -0
- package/build/fixtures/schemas/one-of.js +44 -46
- package/build/fixtures/schemas/one-of.js.map +1 -0
- package/build/fixtures/schemas/string-formats.js +16 -15
- package/build/fixtures/schemas/string-formats.js.map +1 -0
- package/build/fixtures/utils/image-util.js +9 -8
- package/build/fixtures/utils/image-util.js.map +1 -0
- package/build/formControl/FormControl.js +119 -148
- package/build/formControl/FormControl.js.map +1 -0
- package/build/formControl/index.js +7 -14
- package/build/formControl/index.js.map +1 -0
- package/build/formControl/utils/index.js +2 -1
- package/build/formControl/utils/index.js.map +1 -0
- package/build/formControl/utils/value-utils.js +19 -23
- package/build/formControl/utils/value-utils.js.map +1 -0
- package/build/i18n/index.js +32 -31
- package/build/i18n/index.js.map +1 -0
- package/build/index.js +14 -10
- package/build/index.js.map +1 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +13 -24
- package/build/jsonSchemaForm/JsonSchemaForm.js.map +1 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +25 -37
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/allOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +10 -20
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +10 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +57 -115
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +8 -7
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +20 -71
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +11 -11
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +46 -62
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js.map +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +7 -14
- package/build/jsonSchemaForm/basicTypeSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +40 -50
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +19 -18
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +7 -14
- package/build/jsonSchemaForm/controlFeedback/index.js.map +1 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +53 -61
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js.map +1 -0
- package/build/jsonSchemaForm/genericSchema/index.js +7 -14
- package/build/jsonSchemaForm/genericSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/help/Help.js +10 -9
- package/build/jsonSchemaForm/help/Help.js.map +1 -0
- package/build/jsonSchemaForm/help/Help.messages.js +6 -5
- package/build/jsonSchemaForm/help/Help.messages.js.map +1 -0
- package/build/jsonSchemaForm/help/index.js +7 -14
- package/build/jsonSchemaForm/help/index.js.map +1 -0
- package/build/jsonSchemaForm/index.js +7 -14
- package/build/jsonSchemaForm/index.js.map +1 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +29 -49
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js.map +1 -0
- package/build/jsonSchemaForm/objectSchema/index.js +7 -14
- package/build/jsonSchemaForm/objectSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +55 -74
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/oneOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +4 -3
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +2 -1
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +20 -20
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +12 -22
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +6 -5
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +74 -127
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +46 -110
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +18 -17
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +29 -47
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +5 -4
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +14 -24
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +12 -22
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +13 -23
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +25 -26
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +7 -6
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +7 -14
- package/build/jsonSchemaForm/readOnlySchema/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +27 -39
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +7 -14
- package/build/jsonSchemaForm/schemaFormControl/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +6 -5
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +2 -1
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +31 -47
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js.map +1 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +58 -119
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js.map +1 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +7 -14
- package/build/jsonSchemaForm/validationAsyncSchema/index.js.map +1 -0
- package/build/layout/DynamicLayout.js +11 -21
- package/build/layout/DynamicLayout.js.map +1 -0
- package/build/layout/alert/DynamicAlert.js +10 -9
- package/build/layout/alert/DynamicAlert.js.map +1 -0
- package/build/layout/box/DynamicBox.js +13 -23
- package/build/layout/box/DynamicBox.js.map +1 -0
- package/build/layout/button/DynamicButton.js +17 -27
- package/build/layout/button/DynamicButton.js.map +1 -0
- package/build/layout/columns/DynamicColumns.js +14 -24
- package/build/layout/columns/DynamicColumns.js.map +1 -0
- package/build/layout/decision/DynamicDecision.js +17 -27
- package/build/layout/decision/DynamicDecision.js.map +1 -0
- package/build/layout/divider/DynamicDivider.js +8 -8
- package/build/layout/divider/DynamicDivider.js.map +1 -0
- package/build/layout/external/DynamicExternal.js +17 -28
- package/build/layout/external/DynamicExternal.js.map +1 -0
- package/build/layout/external/DynamicExternal.messages.js +6 -5
- package/build/layout/external/DynamicExternal.messages.js.map +1 -0
- package/build/layout/form/DynamicForm.js +11 -21
- package/build/layout/form/DynamicForm.js.map +1 -0
- package/build/layout/heading/DynamicHeading.js +13 -23
- package/build/layout/heading/DynamicHeading.js.map +1 -0
- package/build/layout/icon/DynamicIcon.js +10 -10
- package/build/layout/icon/DynamicIcon.js.map +1 -0
- package/build/layout/image/DynamicImage.js +44 -93
- package/build/layout/image/DynamicImage.js.map +1 -0
- package/build/layout/index.js +22 -29
- package/build/layout/index.js.map +1 -0
- package/build/layout/info/DynamicInfo.js +8 -19
- package/build/layout/info/DynamicInfo.js.map +1 -0
- package/build/layout/list/DynamicList.js +15 -26
- package/build/layout/list/DynamicList.js.map +1 -0
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +9 -9
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js.map +1 -0
- package/build/layout/paragraph/DynamicParagraph.js +20 -37
- package/build/layout/paragraph/DynamicParagraph.js.map +1 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +7 -6
- package/build/layout/paragraph/DynamicParagraph.messages.js.map +1 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +5 -4
- package/build/layout/paragraph/useSnackBarIfAvailable.js.map +1 -0
- package/build/layout/review/DynamicReview.js +15 -26
- package/build/layout/review/DynamicReview.js.map +1 -0
- package/build/layout/utils.js +5 -6
- package/build/layout/utils.js.map +1 -0
- package/build/step/cameraStep/CameraStep.js +43 -88
- package/build/step/cameraStep/CameraStep.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +49 -105
- package/build/step/cameraStep/cameraCapture/CameraCapture.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +8 -7
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +11 -28
- package/build/step/cameraStep/cameraCapture/components/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +18 -72
- package/build/step/cameraStep/cameraCapture/hooks/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/index.js +7 -14
- package/build/step/cameraStep/cameraCapture/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +34 -45
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +9 -19
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +7 -6
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +10 -21
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +8 -7
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +7 -14
- package/build/step/cameraStep/cameraCapture/screens/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +18 -99
- package/build/step/cameraStep/cameraCapture/tracking/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +34 -96
- package/build/step/cameraStep/cameraCapture/utils/index.js.map +1 -0
- package/build/step/cameraStep/index.js +7 -14
- package/build/step/cameraStep/index.js.map +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +21 -21
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js.map +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +9 -8
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js.map +1 -0
- package/build/step/externalConfirmationStep/index.js +7 -14
- package/build/step/externalConfirmationStep/index.js.map +1 -0
- package/build/step/index.js +8 -15
- package/build/step/index.js.map +1 -0
- package/build/step/layoutStep/LayoutStep.js +20 -19
- package/build/step/layoutStep/LayoutStep.js.map +1 -0
- package/build/step/layoutStep/index.js +7 -14
- package/build/step/layoutStep/index.js.map +1 -0
- package/build/step/layoutStep/utils/index.js +4 -14
- package/build/step/layoutStep/utils/index.js.map +1 -0
- package/build/step/layoutStep/utils/inline-reference-utils.js +30 -46
- package/build/step/layoutStep/utils/inline-reference-utils.js.map +1 -0
- package/build/step/layoutStep/utils/layout-utils.js +35 -53
- package/build/step/layoutStep/utils/layout-utils.js.map +1 -0
- package/build/types/common/FormControl.js +2 -1
- package/build/types/common/FormControl.js.map +1 -0
- package/build/types/index.js +14 -13
- package/build/types/index.js.map +1 -0
- package/build/types/specification/Action.js +2 -1
- package/build/types/specification/Action.js.map +1 -0
- package/build/types/specification/FileUploadSchema.js +2 -1
- package/build/types/specification/FileUploadSchema.js.map +1 -0
- package/build/types/specification/LayoutComponent.js +2 -1
- package/build/types/specification/LayoutComponent.js.map +1 -0
- package/build/types/specification/Model.js +10 -17
- package/build/types/specification/Model.js.map +1 -0
- package/build/types/specification/PersistAsync.js +2 -1
- package/build/types/specification/PersistAsync.js.map +1 -0
- package/build/types/specification/Polling.js +2 -1
- package/build/types/specification/Polling.js.map +1 -0
- package/build/types/specification/Promotion.js +2 -1
- package/build/types/specification/Promotion.js.map +1 -0
- package/build/types/specification/Schema.js +9 -8
- package/build/types/specification/Schema.js.map +1 -0
- package/build/types/specification/Step.js +4 -5
- package/build/types/specification/Step.js.map +1 -0
- package/build/types/specification/ValidationAsync.js +2 -1
- package/build/types/specification/ValidationAsync.js.map +1 -0
- package/build/types/specification/core.js +2 -1
- package/build/types/specification/core.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,62 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.__esModule = true;
|
|
50
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
51
|
-
var react_1 = require("react");
|
|
52
|
-
var react_intl_1 = require("react-intl");
|
|
53
|
-
var contexts_1 = require("../common/contexts");
|
|
54
|
-
var validators_1 = require("../common/validators");
|
|
55
|
-
var types_1 = require("../types");
|
|
56
|
-
var DynamicFlowStep_1 = require("./DynamicFlowStep");
|
|
57
|
-
var utils_1 = require("./utils");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_intl_1 = require("react-intl");
|
|
6
|
+
const contexts_1 = require("../common/contexts");
|
|
7
|
+
const validators_1 = require("../common/validators");
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
const DynamicFlowStep_1 = require("./DynamicFlowStep");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
58
11
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
59
|
-
|
|
12
|
+
const noop = () => { };
|
|
60
13
|
/**
|
|
61
14
|
* ## DynamicFlow
|
|
62
15
|
*
|
|
@@ -66,307 +19,233 @@ var noop = function () { };
|
|
|
66
19
|
* and reformats it to use a LayoutStep for presentation.
|
|
67
20
|
*
|
|
68
21
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var action = _a.action, data = _a.data, etag = _a.etag;
|
|
82
|
-
var url = action.url, _b = action.method, method = _b === void 0 ? 'POST' : _b;
|
|
22
|
+
const DynamicFlowComponent = ({ flowId, fetcher, flowUrl, initialAction, initialStep, loaderConfig, displayStepTitle = true, onComplete, onStepChange = noop, onError, onEvent = noop, onLog = noop, }) => {
|
|
23
|
+
const { locale } = (0, react_intl_1.useIntl)();
|
|
24
|
+
const { formErrors, globalError, step, models, etag, modelIsValid, setFormErrors, setGlobalError, setStepAndEtag, setSchemaModel, } = (0, utils_1.useDynamicFlowState)(initialStep);
|
|
25
|
+
const [submitted, setSubmitted] = (0, react_1.useState)(false);
|
|
26
|
+
const { loadingState, setLoadingState, loader } = (0, utils_1.useLoader)(loaderConfig, initialStep ? 'idle' : 'initial');
|
|
27
|
+
const logWarning = (0, contexts_1.getLogger)('warning', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
|
|
28
|
+
const logError = (0, contexts_1.getLogger)('error', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
|
|
29
|
+
const logCritical = (0, contexts_1.getLogger)('critical', onLog, flowId, step === null || step === void 0 ? void 0 : step.key);
|
|
30
|
+
const analyticsMetadata = (0, react_1.useMemo)(() => { var _a; return (Object.assign({ flowId, stepId: step === null || step === void 0 ? void 0 : step.key }, ((_a = step === null || step === void 0 ? void 0 : step.analytics) !== null && _a !== void 0 ? _a : {}))); }, [flowId, step]);
|
|
31
|
+
const dispatchEvent = (0, react_1.useMemo)(() => (0, contexts_1.getEventDispatcher)(onEvent, analyticsMetadata), [onEvent, analyticsMetadata]);
|
|
32
|
+
const triggerActionRequest = (0, react_1.useCallback)(({ action, data, etag }) => {
|
|
33
|
+
const { url, method = 'POST' } = action;
|
|
83
34
|
return fetcher(url !== null && url !== void 0 ? url : '', {
|
|
84
|
-
method
|
|
85
|
-
headers:
|
|
35
|
+
method,
|
|
36
|
+
headers: Object.assign({ 'accept-language': locale, 'Content-Type': 'application/json' }, (etag ? { 'If-None-Match': etag } : {})),
|
|
86
37
|
credentials: 'include',
|
|
87
|
-
body: method === 'GET' ? undefined : JSON.stringify(data)
|
|
38
|
+
body: method === 'GET' ? undefined : JSON.stringify(data),
|
|
88
39
|
});
|
|
89
40
|
}, [fetcher, locale]);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
_a.trys.push([1, 3, , 4]);
|
|
101
|
-
dispatchEvent('Dynamic Flow - Step Submitted', { actionId: action.$id });
|
|
102
|
-
return [4 /*yield*/, triggerActionRequest({ action: action, data: data })];
|
|
103
|
-
case 2:
|
|
104
|
-
response = _a.sent();
|
|
105
|
-
return [2 /*return*/, handleFetchResponse(response, 'submission')];
|
|
106
|
-
case 3:
|
|
107
|
-
error_1 = _a.sent();
|
|
108
|
-
handleFetchError(error_1, 'Error fetching next step');
|
|
109
|
-
return [3 /*break*/, 4];
|
|
110
|
-
case 4: return [2 /*return*/];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
41
|
+
const fetchNextStep = async (action, data = {}) => {
|
|
42
|
+
setLoadingState(loadingState === 'initial' ? 'initial' : 'submission');
|
|
43
|
+
try {
|
|
44
|
+
dispatchEvent('Dynamic Flow - Step Submitted', { actionId: action.$id });
|
|
45
|
+
const response = await triggerActionRequest({ action, data });
|
|
46
|
+
return handleFetchResponse(response, 'submission');
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
handleFetchError(error, 'Error fetching next step');
|
|
50
|
+
}
|
|
114
51
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
}); };
|
|
141
|
-
var fetchExitResult = function (action, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
142
|
-
var response, exitResult, error_3;
|
|
143
|
-
return __generator(this, function (_a) {
|
|
144
|
-
switch (_a.label) {
|
|
145
|
-
case 0:
|
|
146
|
-
_a.trys.push([0, 3, , 4]);
|
|
147
|
-
return [4 /*yield*/, triggerActionRequest({ action: action, data: data })];
|
|
148
|
-
case 1:
|
|
149
|
-
response = _a.sent();
|
|
150
|
-
return [4 /*yield*/, (0, utils_1.parseExitResponse)(response)];
|
|
151
|
-
case 2:
|
|
152
|
-
exitResult = _a.sent();
|
|
153
|
-
onCloseWithEvent(__assign(__assign({}, exitResult), action.result));
|
|
154
|
-
return [3 /*break*/, 4];
|
|
155
|
-
case 3:
|
|
156
|
-
error_3 = _a.sent();
|
|
157
|
-
handleFetchError(error_3, 'Error fetching exit result');
|
|
158
|
-
return [3 /*break*/, 4];
|
|
159
|
-
case 4: return [2 /*return*/];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}); };
|
|
163
|
-
var debouncedFetchRefresh = (0, utils_1.useDebouncedRefresh)(fetchRefreshStep);
|
|
164
|
-
var onCloseWithEvent = (0, react_1.useCallback)(function (result) {
|
|
52
|
+
const fetchRefreshStep = async (action, data, etag) => {
|
|
53
|
+
setLoadingState('refresh');
|
|
54
|
+
try {
|
|
55
|
+
dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'pending' });
|
|
56
|
+
const response = await triggerActionRequest({ action, data, etag });
|
|
57
|
+
await handleFetchResponse(response, 'refresh');
|
|
58
|
+
setLoadingState('idle');
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
handleFetchError(error, 'Error fetching refresh step');
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const fetchExitResult = async (action, data) => {
|
|
65
|
+
try {
|
|
66
|
+
const response = await triggerActionRequest({ action, data });
|
|
67
|
+
const exitResult = await (0, utils_1.parseExitResponse)(response);
|
|
68
|
+
onCloseWithEvent(Object.assign(Object.assign({}, exitResult), action.result));
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
handleFetchError(error, 'Error fetching exit result');
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const debouncedFetchRefresh = (0, utils_1.useDebouncedRefresh)(fetchRefreshStep);
|
|
75
|
+
const onCloseWithEvent = (0, react_1.useCallback)((result) => {
|
|
165
76
|
dispatchEvent('Dynamic Flow - Flow Finished', { result: 'success' });
|
|
166
77
|
onComplete(result);
|
|
167
78
|
}, [onComplete, dispatchEvent]);
|
|
168
|
-
(0, react_1.useEffect)(
|
|
79
|
+
(0, react_1.useEffect)(() => {
|
|
169
80
|
dispatchEvent('Dynamic Flow - Flow Started', {});
|
|
170
81
|
}, []);
|
|
171
|
-
(0, react_1.useEffect)(
|
|
82
|
+
(0, react_1.useEffect)(() => {
|
|
172
83
|
if (!initialStep) {
|
|
173
|
-
|
|
84
|
+
const action = Object.assign({ $id: '#initial-step-request', method: 'GET' }, initialAction);
|
|
174
85
|
void fetchNextStep(action, action.data);
|
|
175
86
|
}
|
|
176
87
|
}, [flowUrl, fetcher, locale, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
case 'exit':
|
|
194
|
-
return [2 /*return*/, onCloseWithEvent(parsedResponse.result)];
|
|
195
|
-
case 'step':
|
|
196
|
-
default: {
|
|
197
|
-
step_1 = parsedResponse.step, etag_1 = parsedResponse.etag;
|
|
198
|
-
return [2 /*return*/, fetchType === 'submission'
|
|
199
|
-
? updateStepAfterSubmission(step_1, etag_1)
|
|
200
|
-
: updateStepAfterRefresh(step_1, etag_1)];
|
|
201
|
-
}
|
|
88
|
+
const handleFetchResponse = async (response, fetchType) => {
|
|
89
|
+
if (response.ok) {
|
|
90
|
+
try {
|
|
91
|
+
const parsedResponse = await (0, utils_1.parseFetchResponse)(response);
|
|
92
|
+
switch (parsedResponse.type) {
|
|
93
|
+
case 'action':
|
|
94
|
+
void fetchNextStep(parsedResponse.action, parsedResponse.action.data);
|
|
95
|
+
return;
|
|
96
|
+
case 'exit':
|
|
97
|
+
return onCloseWithEvent(parsedResponse.result);
|
|
98
|
+
case 'step':
|
|
99
|
+
default: {
|
|
100
|
+
const { step, etag } = parsedResponse;
|
|
101
|
+
return fetchType === 'submission'
|
|
102
|
+
? updateStepAfterSubmission(step, etag)
|
|
103
|
+
: updateStepAfterRefresh(step, etag);
|
|
202
104
|
}
|
|
203
|
-
|
|
204
|
-
case 3:
|
|
205
|
-
error_4 = _a.sent();
|
|
206
|
-
return [2 /*return*/, handleFetchError(error_4, 'Error parsing fetch response')];
|
|
207
|
-
case 4: return [2 /*return*/, handleErrorResponse(response, fetchType)];
|
|
105
|
+
}
|
|
208
106
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
107
|
+
catch (error) {
|
|
108
|
+
return handleFetchError(error, 'Error parsing fetch response');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return handleErrorResponse(response, fetchType);
|
|
112
|
+
};
|
|
113
|
+
const updateStepAfterSubmission = (newStep, etag) => {
|
|
114
|
+
const previousStep = step;
|
|
213
115
|
setStepAndEtag(newStep, etag);
|
|
214
116
|
onStepChange(newStep, previousStep);
|
|
215
117
|
setSubmitted(false);
|
|
216
118
|
setLoadingState('idle');
|
|
217
|
-
dispatchEvent('Dynamic Flow - Step Started',
|
|
119
|
+
dispatchEvent('Dynamic Flow - Step Started', Object.assign({ stepId: newStep.key }, newStep === null || newStep === void 0 ? void 0 : newStep.analytics));
|
|
218
120
|
};
|
|
219
|
-
|
|
121
|
+
const updateStepAfterRefresh = (step, etag) => {
|
|
220
122
|
setStepAndEtag(step, etag);
|
|
221
123
|
setLoadingState('idle');
|
|
222
124
|
dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'success' });
|
|
223
125
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
case 1:
|
|
235
|
-
_a.trys.push([1, 5, , 6]);
|
|
236
|
-
return [4 /*yield*/, (0, utils_1.parseErrorResponse)(response)];
|
|
237
|
-
case 2:
|
|
238
|
-
errorBody = _a.sent();
|
|
239
|
-
if (!errorBody.refreshFormUrl) return [3 /*break*/, 4];
|
|
240
|
-
action = { url: errorBody === null || errorBody === void 0 ? void 0 : errorBody.refreshFormUrl, method: 'POST' };
|
|
241
|
-
return [4 /*yield*/, fetchRefreshStep(action, combineModels(models), etag)];
|
|
242
|
-
case 3:
|
|
243
|
-
_a.sent();
|
|
244
|
-
_a.label = 4;
|
|
245
|
-
case 4:
|
|
246
|
-
if (errorBody.validation) {
|
|
247
|
-
setFormErrors(errorBody.validation);
|
|
248
|
-
}
|
|
249
|
-
if (errorBody.error) {
|
|
250
|
-
setGlobalError(errorBody.error);
|
|
251
|
-
}
|
|
252
|
-
if (!errorBody.refreshFormUrl && !errorBody.validation && !errorBody.error) {
|
|
253
|
-
logError('Invalid response', 'Response body must contain at least one of the following properties: refreshFormUrl, validation, or error.');
|
|
254
|
-
throw errorBody;
|
|
255
|
-
}
|
|
256
|
-
return [3 /*break*/, 6];
|
|
257
|
-
case 5:
|
|
258
|
-
error_5 = _a.sent();
|
|
259
|
-
if (fetchType === 'refresh') {
|
|
260
|
-
dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'failure' });
|
|
261
|
-
}
|
|
262
|
-
dispatchEvent('Dynamic Flow - Flow Finished', { status: 'failure' });
|
|
263
|
-
onError(error_5, response.status);
|
|
264
|
-
logError('Invalid response', 'Error response body must be an object.');
|
|
265
|
-
return [3 /*break*/, 6];
|
|
266
|
-
case 6:
|
|
267
|
-
setLoadingState('idle');
|
|
268
|
-
return [2 /*return*/];
|
|
126
|
+
const handleErrorResponse = async (response, fetchType) => {
|
|
127
|
+
if (response.status === 304) {
|
|
128
|
+
setLoadingState('idle');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
const errorBody = await (0, utils_1.parseErrorResponse)(response);
|
|
133
|
+
if (errorBody.refreshFormUrl) {
|
|
134
|
+
const action = { url: errorBody === null || errorBody === void 0 ? void 0 : errorBody.refreshFormUrl, method: 'POST' };
|
|
135
|
+
await fetchRefreshStep(action, combineModels(models), etag);
|
|
269
136
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
137
|
+
if (errorBody.validation) {
|
|
138
|
+
setFormErrors(errorBody.validation);
|
|
139
|
+
}
|
|
140
|
+
if (errorBody.error) {
|
|
141
|
+
setGlobalError(errorBody.error);
|
|
142
|
+
}
|
|
143
|
+
if (!errorBody.refreshFormUrl && !errorBody.validation && !errorBody.error) {
|
|
144
|
+
logError('Invalid response', 'Response body must contain at least one of the following properties: refreshFormUrl, validation, or error.');
|
|
145
|
+
throw errorBody;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
if (fetchType === 'refresh') {
|
|
150
|
+
dispatchEvent('Dynamic Flow - Step Refreshed', { status: 'failure' });
|
|
151
|
+
}
|
|
152
|
+
dispatchEvent('Dynamic Flow - Flow Finished', { status: 'failure' });
|
|
153
|
+
onError(error, response.status);
|
|
154
|
+
logError('Invalid response', 'Error response body must be an object.');
|
|
155
|
+
}
|
|
156
|
+
setLoadingState('idle');
|
|
157
|
+
};
|
|
158
|
+
const handleFetchError = (error, message) => {
|
|
273
159
|
logCritical('Error fetching', message);
|
|
274
160
|
onError(error);
|
|
275
161
|
setLoadingState('idle');
|
|
276
162
|
};
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
163
|
+
const onModelChange = (onModelChangeProps) => {
|
|
164
|
+
const { model, formSchema } = onModelChangeProps;
|
|
165
|
+
const { $id = '' } = formSchema;
|
|
280
166
|
setGlobalError(null);
|
|
281
167
|
if (!(0, types_1.isObjectModel)(model)) {
|
|
282
168
|
// TODO: MC-3224
|
|
283
169
|
logCritical('Invalid model on change', 'onModelChange was called but the model argument is not an object');
|
|
284
170
|
}
|
|
285
|
-
|
|
286
|
-
setSchemaModel($id, objectModel,
|
|
171
|
+
const objectModel = model;
|
|
172
|
+
setSchemaModel($id, objectModel, (updatedModels) => {
|
|
287
173
|
refreshOnChangeIfNeeded(onModelChangeProps, updatedModels);
|
|
288
174
|
});
|
|
289
175
|
};
|
|
290
|
-
|
|
291
|
-
|
|
176
|
+
const refreshOnChangeIfNeeded = (props, updatedModels) => {
|
|
177
|
+
const { triggerSchema } = props;
|
|
292
178
|
if (shouldTriggerRefresh(props)) {
|
|
293
|
-
|
|
294
|
-
|
|
179
|
+
const url = triggerSchema.refreshFormUrl || (step === null || step === void 0 ? void 0 : step.refreshFormUrl);
|
|
180
|
+
const action = { url, method: 'POST' };
|
|
295
181
|
debouncedFetchRefresh(action, combineModels(updatedModels), etag, triggerSchema);
|
|
296
182
|
}
|
|
297
183
|
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (!isSubmissionMethod(method)) return [3 /*break*/, 3];
|
|
184
|
+
const onAction = async (action) => {
|
|
185
|
+
const { data, method, exit, url, result } = action;
|
|
186
|
+
const submissionData = Object.assign(Object.assign({}, combineModels(models)), data);
|
|
187
|
+
// Temporary tracking properties specific to recipient creation
|
|
188
|
+
// the submissionData object typically contains PII
|
|
189
|
+
// but we're only taking "currency" and "type" which are not PII.
|
|
190
|
+
const extraLoggingProps = {
|
|
191
|
+
url: action.url,
|
|
192
|
+
method: action.method,
|
|
193
|
+
currency: submissionData.currency,
|
|
194
|
+
type: submissionData.type,
|
|
195
|
+
};
|
|
196
|
+
if (loadingState !== 'idle' || action.disabled) {
|
|
197
|
+
logWarning('Action supressed', loadingState !== 'idle'
|
|
198
|
+
? `onAction was supressed because loadingState is ${loadingState}`
|
|
199
|
+
: `onAction was supressed because action is disabled`, extraLoggingProps);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (exit) {
|
|
203
|
+
if (url) {
|
|
204
|
+
if (isSubmissionMethod(method)) {
|
|
320
205
|
setFormErrors(null);
|
|
321
206
|
setSubmitted(true);
|
|
322
|
-
if (
|
|
323
|
-
|
|
324
|
-
case 1:
|
|
325
|
-
_a.sent();
|
|
326
|
-
_a.label = 2;
|
|
327
|
-
case 2: return [3 /*break*/, 5];
|
|
328
|
-
case 3: return [4 /*yield*/, fetchExitResult(action)];
|
|
329
|
-
case 4:
|
|
330
|
-
_a.sent();
|
|
331
|
-
_a.label = 5;
|
|
332
|
-
case 5: return [2 /*return*/];
|
|
333
|
-
case 6:
|
|
334
|
-
onCloseWithEvent(result);
|
|
335
|
-
return [2 /*return*/];
|
|
336
|
-
case 7:
|
|
337
|
-
if (isSubmissionMethod(method)) {
|
|
338
|
-
setFormErrors(null);
|
|
339
|
-
setSubmitted(true);
|
|
340
|
-
if (modelIsValid) {
|
|
341
|
-
void fetchNextStep(action, submissionData);
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
dispatchEvent('Dynamic Flow - onAction supressed', __assign({ reason: 'invalid model' }, extraLoggingProps));
|
|
345
|
-
}
|
|
346
|
-
return [2 /*return*/];
|
|
207
|
+
if (modelIsValid) {
|
|
208
|
+
await fetchExitResult(action, submissionData);
|
|
347
209
|
}
|
|
348
|
-
|
|
349
|
-
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
await fetchExitResult(action);
|
|
213
|
+
}
|
|
214
|
+
return;
|
|
350
215
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
216
|
+
onCloseWithEvent(result);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (isSubmissionMethod(method)) {
|
|
220
|
+
setFormErrors(null);
|
|
221
|
+
setSubmitted(true);
|
|
222
|
+
if (modelIsValid) {
|
|
223
|
+
void fetchNextStep(action, submissionData);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
dispatchEvent('Dynamic Flow - onAction supressed', Object.assign({ reason: 'invalid model' }, extraLoggingProps));
|
|
227
|
+
}
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
void fetchNextStep(action);
|
|
231
|
+
};
|
|
232
|
+
return ((0, jsx_runtime_1.jsx)(contexts_1.LogProvider, Object.assign({ flowId: flowId, stepId: step === null || step === void 0 ? void 0 : step.key, onLog: onLog }, { children: (0, jsx_runtime_1.jsx)(contexts_1.EventsContextProvider, Object.assign({ metadata: analyticsMetadata, onEvent: onEvent }, { children: (0, jsx_runtime_1.jsx)(contexts_1.DynamicFlowProvider, Object.assign({ loading: loadingState !== 'idle' }, { children: (0, jsx_runtime_1.jsx)(contexts_1.FetcherProvider, Object.assign({ fetcher: fetcher }, { children: loader !== null ? (loader) : ((0, jsx_runtime_1.jsx)(DynamicFlowStep_1.DynamicFlowStep, { step: step, model: combineModels(models), submitted: submitted, globalError: globalError, formErrors: formErrors, stepLayoutOptions: { displayStepTitle }, onAction: (action) => {
|
|
354
233
|
void onAction(action);
|
|
355
234
|
}, onModelChange: onModelChange })) })) })) })) })));
|
|
356
235
|
};
|
|
357
|
-
|
|
358
|
-
exports
|
|
359
|
-
|
|
360
|
-
return Object.values(formModels).reduce(
|
|
236
|
+
const DynamicFlow = (props) => ((0, jsx_runtime_1.jsx)(utils_1.ErrorBoundary, Object.assign({ onError: props.onError }, { children: (0, jsx_runtime_1.jsx)(DynamicFlowComponent, Object.assign({}, props)) })));
|
|
237
|
+
exports.default = DynamicFlow;
|
|
238
|
+
const combineModels = (formModels) => {
|
|
239
|
+
return Object.values(formModels).reduce((previous, model) => (Object.assign(Object.assign({}, previous), model)), {});
|
|
361
240
|
};
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
var submissionMethods = ['POST', 'PUT', 'PATCH'];
|
|
241
|
+
const isSubmissionMethod = (method = 'POST') => {
|
|
242
|
+
const submissionMethods = ['POST', 'PUT', 'PATCH'];
|
|
365
243
|
return submissionMethods.includes(method.toUpperCase());
|
|
366
244
|
};
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
245
|
+
const shouldTriggerRefresh = (props) => {
|
|
246
|
+
const { type, triggerSchema, triggerModel, lastTriggerModel = null } = props;
|
|
247
|
+
const isValid = () => (0, validators_1.isValidSchema)(triggerModel, triggerSchema);
|
|
248
|
+
const wasValid = () => (0, validators_1.isValidSchema)(lastTriggerModel, triggerSchema);
|
|
371
249
|
return type !== 'init' && (triggerSchema === null || triggerSchema === void 0 ? void 0 : triggerSchema.refreshFormOnChange) && (isValid() || wasValid());
|
|
372
250
|
};
|
|
251
|
+
//# sourceMappingURL=DynamicFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicFlow.js","sourceRoot":"","sources":["../../src/dynamicFlow/DynamicFlow.tsx"],"names":[],"mappings":";;;AAAA,iCAAuE;AACvE,2CAAqC;AAErC,iDAO4B;AAC5B,qDAAqD;AAOrD,oCAAoE;AAEpE,uDAAoD;AACpD,mCAQiB;AAEjB,gEAAgE;AAChE,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAItB;;;;;;;;GAQG;AACH,MAAM,oBAAoB,GAA0B,CAAC,EACnD,MAAM,EACN,OAAO,EACP,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,GAAG,IAAI,EACvB,UAAU,EACV,YAAY,GAAG,IAAI,EACnB,OAAO,EACP,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,IAAI,GACb,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IAE7B,MAAM,EACJ,UAAU,EACV,WAAW,EACX,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,cAAc,E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