@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,27 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.DynamicFlowStep = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const hooks_1 = require("../common/hooks");
|
|
6
|
+
const utils_1 = require("../common/utils");
|
|
7
|
+
const layout_1 = require("../layout");
|
|
8
|
+
const step_1 = require("../step");
|
|
9
|
+
const DynamicFlowStep = (props) => {
|
|
21
10
|
var _a;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
const { step, globalError } = props;
|
|
12
|
+
const externalUrl = (_a = step === null || step === void 0 ? void 0 : step.external) === null || _a === void 0 ? void 0 : _a.url;
|
|
13
|
+
const { requiresManualTrigger, dismissConfirmation } = (0, hooks_1.useExternal)(externalUrl);
|
|
25
14
|
if (step === undefined) {
|
|
26
15
|
return null;
|
|
27
16
|
}
|
|
@@ -29,8 +18,9 @@ var DynamicFlowStep = function (props) {
|
|
|
29
18
|
return (0, jsx_runtime_1.jsx)(step_1.ExternalConfirmationStep, { url: externalUrl, onClose: dismissConfirmation });
|
|
30
19
|
}
|
|
31
20
|
if ((0, utils_1.getStepType)(step) === 'camera') {
|
|
32
|
-
return (0, jsx_runtime_1.jsx)(step_1.CameraStep,
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(step_1.CameraStep, Object.assign({}, props, { step: step }));
|
|
33
22
|
}
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [globalError ? ((0, jsx_runtime_1.jsx)(layout_1.DynamicAlert, { component: { context: 'negative', markdown: globalError, margin: 'lg' } })) : null, (0, jsx_runtime_1.jsx)(step_1.LayoutStep,
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [globalError ? ((0, jsx_runtime_1.jsx)(layout_1.DynamicAlert, { component: { context: 'negative', markdown: globalError, margin: 'lg' } })) : null, (0, jsx_runtime_1.jsx)(step_1.LayoutStep, Object.assign({}, props, { stepSpecification: step }))] }));
|
|
35
24
|
};
|
|
36
25
|
exports.DynamicFlowStep = DynamicFlowStep;
|
|
26
|
+
//# sourceMappingURL=DynamicFlowStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicFlowStep.js","sourceRoot":"","sources":["../../src/dynamicFlow/DynamicFlowStep.tsx"],"names":[],"mappings":";;;;AAAA,2CAA8C;AAC9C,2CAA8C;AAC9C,sCAAyC;AACzC,kCAA2E;AAQpE,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;;IAC7D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAEpC,MAAM,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,0CAAE,GAAG,CAAC;IAExC,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,IAAA,mBAAW,EAAC,WAAW,CAAC,CAAC;IAEhF,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,WAAW,IAAI,qBAAqB,EAAE;QACxC,OAAO,uBAAC,+BAAwB,IAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAI,CAAC;KACrF;IAED,IAAI,IAAA,mBAAW,EAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QAClC,OAAO,uBAAC,iBAAU,oBAAK,KAAK,IAAE,IAAI,EAAE,IAAI,IAAI,CAAC;KAC9C;IAED,OAAO,CACL,6DACG,WAAW,CAAC,CAAC,CAAC,CACb,uBAAC,qBAAY,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI,CAC1F,CAAC,CAAC,CAAC,IAAI,EACR,uBAAC,iBAAU,oBAAK,KAAK,IAAE,iBAAiB,EAAE,IAAI,IAAI,IACjD,CACJ,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,eAAe,mBA2B1B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isSchema = void 0;
|
|
4
4
|
// TODO HD Move this out of types
|
|
5
5
|
function isSchema(schema) {
|
|
6
6
|
return Object.prototype.hasOwnProperty.call(schema, '$ref') === false;
|
|
7
7
|
}
|
|
8
8
|
exports.isSchema = isSchema;
|
|
9
|
+
//# sourceMappingURL=DynamicFlowTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicFlowTypes.js","sourceRoot":"","sources":["../../src/dynamicFlow/DynamicFlowTypes.ts"],"names":[],"mappings":";;;AAgCA,iCAAiC;AACjC,SAAgB,QAAQ,CAAC,MAA4B;IACnD,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,KAAK,CAAC;AACxE,CAAC;AAFD,4BAEC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
14
|
-
exports["default"] = void 0;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
15
7
|
var DynamicFlow_1 = require("./DynamicFlow");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(DynamicFlow_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dynamicFlow/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AAA/B,uHAAA,OAAO,OAAA"}
|
|
@@ -2,35 +2,36 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getObjectKeys = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const addon_actions_1 = require("@storybook/addon-actions");
|
|
9
|
+
const react_1 = require("@storybook/react");
|
|
10
|
+
const fixtures_1 = require("../../fixtures");
|
|
11
|
+
const DynamicFlow_1 = __importDefault(require("../DynamicFlow"));
|
|
12
|
+
const EditableDynamicFlow_1 = __importDefault(require("./EditableDynamicFlow"));
|
|
13
|
+
const fixtureFetcher_1 = require("./fixtureFetcher");
|
|
14
14
|
exports.getObjectKeys = Object.keys;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
allStepNames.forEach(
|
|
15
|
+
const storyMap = {};
|
|
16
|
+
const allStepNames = (0, exports.getObjectKeys)(fixtures_1.fixtures.steps);
|
|
17
|
+
allStepNames.forEach((stepName) => {
|
|
18
18
|
var _a;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const label = (_a = fixtures_1.fixtures.steps[stepName].key) !== null && _a !== void 0 ? _a : stepName;
|
|
20
|
+
const [group, name] = label.split('/');
|
|
21
21
|
if (!storyMap[group]) {
|
|
22
|
-
storyMap[group] = (0, react_1.storiesOf)(
|
|
22
|
+
storyMap[group] = (0, react_1.storiesOf)(`Dynamic Flow/${group}`, module);
|
|
23
23
|
}
|
|
24
|
-
storyMap[group].add(name,
|
|
24
|
+
storyMap[group].add(name, () => ((0, jsx_runtime_1.jsx)(DynamicFlow_1.default, { flowId: "storybook", initialAction: { method: 'GET', url: `/steps/${stepName}` }, fetcher: fixtureFetcher_1.fixtureFetcher, loaderConfig: { size: 'xl', initial: true, submission: false }, onComplete: (0, addon_actions_1.action)('onComplete'), onStepChange: (0, addon_actions_1.action)('onStepChange'), onError: (0, addon_actions_1.action)('onError'), onEvent: (0, addon_actions_1.action)('onEvent'), onLog: (0, addon_actions_1.action)('onLog') }, stepName)));
|
|
25
25
|
});
|
|
26
|
-
|
|
27
|
-
editable.add('Dynamic Flow', EditableDynamicFlow_1
|
|
26
|
+
const editable = (0, react_1.storiesOf)(`Dynamic Flow/Editable`, module);
|
|
27
|
+
editable.add('Dynamic Flow', EditableDynamicFlow_1.default, {
|
|
28
28
|
argTypes: {
|
|
29
29
|
initialStepName: {
|
|
30
30
|
label: 'Initial Step',
|
|
31
31
|
control: 'select',
|
|
32
|
-
options: Object.keys(fixtures_1.fixtures.steps)
|
|
33
|
-
}
|
|
32
|
+
options: Object.keys(fixtures_1.fixtures.steps),
|
|
33
|
+
},
|
|
34
34
|
},
|
|
35
|
-
args: { initialStepName: Object.keys(fixtures_1.fixtures)[0] }
|
|
35
|
+
args: { initialStepName: Object.keys(fixtures_1.fixtures)[0] },
|
|
36
36
|
});
|
|
37
|
+
//# sourceMappingURL=DynamicFlow.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicFlow.story.js","sourceRoot":"","sources":["../../../src/dynamicFlow/stories/DynamicFlow.story.tsx"],"names":[],"mappings":";;;;;;;AAAA,4DAAkD;AAClD,4CAA6C;AAE7C,6CAA0C;AAC1C,iEAAyC;AAEzC,gFAAwD;AACxD,qDAAkD;AAErC,QAAA,aAAa,GAAG,MAAM,CAAC,IAAqC,CAAC;AAE1E,MAAM,QAAQ,GAAiD,EAAE,CAAC;AAElE,MAAM,YAAY,GAAG,IAAA,qBAAa,EAAC,mBAAQ,CAAC,KAAK,CAAC,CAAC;AAEnD,YAAY,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;;IAChC,MAAM,KAAK,GAAG,MAAA,mBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,mCAAI,QAAQ,CAAC;IAEvD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,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;CACpD,CAAC,CAAC"}
|
|
@@ -1,39 +1,26 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
7
|
/* eslint-disable react/forbid-dom-props */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var selectedInitialStep = JSON.stringify(selectedStep, null, 2);
|
|
8
|
+
const addon_actions_1 = require("@storybook/addon-actions");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const fixtures_1 = require("../../fixtures");
|
|
11
|
+
const DynamicFlow_1 = __importDefault(require("../DynamicFlow"));
|
|
12
|
+
const fixtureFetcher_1 = require("./fixtureFetcher");
|
|
13
|
+
const EditableDynamicFlow = ({ initialStepName = '' }) => {
|
|
14
|
+
const selectedStep = fixtures_1.fixtures.steps[initialStepName] || {};
|
|
15
|
+
const selectedInitialStep = JSON.stringify(selectedStep, null, 2);
|
|
28
16
|
return (0, jsx_runtime_1.jsx)(InteractiveDemo, { selectedInitialStep: selectedInitialStep }, selectedInitialStep);
|
|
29
17
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var onTextAreaChange = function (event) {
|
|
18
|
+
const InteractiveDemo = ({ selectedInitialStep }) => {
|
|
19
|
+
const [initialStep, setInitialStep] = (0, react_1.useState)(selectedInitialStep);
|
|
20
|
+
const onTextAreaChange = (event) => {
|
|
34
21
|
setInitialStep(event.target.value);
|
|
35
22
|
};
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div",
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ style: { display: 'flex', gap: '1em' } }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ style: { flexBasis: '50%' } }, { children: [(0, jsx_runtime_1.jsx)("h3", { children: "Editable Demo" }), (0, jsx_runtime_1.jsxs)("p", { children: ["You can select an initial step from the drop down in the controls panel.", (0, jsx_runtime_1.jsx)("br", {}), "You can edit the JSON below and see the result on the right."] }), (0, jsx_runtime_1.jsx)("textarea", { wrap: "off", rows: 40, style: { fontFamily: 'monospace', fontSize: '0.9em', width: '100%' }, value: initialStep, onChange: onTextAreaChange })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { flexBasis: '50%' } }, { children: (0, jsx_runtime_1.jsx)(DynamicFlow_1.default, { flowId: "the-flow-id", initialStep: safeParseStepJson(initialStep), fetcher: fixtureFetcher_1.fixtureFetcher, onComplete: (0, addon_actions_1.action)('onComplete'), onStepChange: (0, addon_actions_1.action)('onStepChange'), onError: (0, addon_actions_1.action)('onError'), onEvent: (0, addon_actions_1.action)('onEvent'), onLog: (0, addon_actions_1.action)('onLog') }, initialStep) }))] })));
|
|
37
24
|
};
|
|
38
25
|
function safeParseStepJson(jsonStep) {
|
|
39
26
|
try {
|
|
@@ -51,17 +38,18 @@ function safeParseStepJson(jsonStep) {
|
|
|
51
38
|
components: [
|
|
52
39
|
{
|
|
53
40
|
type: 'alert',
|
|
54
|
-
markdown:
|
|
55
|
-
context: 'warning'
|
|
41
|
+
markdown: `**Error parsing JSON.**`,
|
|
42
|
+
context: 'warning',
|
|
56
43
|
},
|
|
57
44
|
{
|
|
58
45
|
type: 'paragraph',
|
|
59
|
-
text:
|
|
46
|
+
text: ` Invalid syntax or missing elements are preventing the JSON code you entered from being parsed. Carefully review and edit the code for errors such as missing commas or brackets.`,
|
|
60
47
|
},
|
|
61
|
-
]
|
|
48
|
+
],
|
|
62
49
|
},
|
|
63
|
-
]
|
|
50
|
+
],
|
|
64
51
|
};
|
|
65
52
|
}
|
|
66
53
|
}
|
|
67
|
-
exports
|
|
54
|
+
exports.default = EditableDynamicFlow;
|
|
55
|
+
//# sourceMappingURL=EditableDynamicFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditableDynamicFlow.js","sourceRoot":"","sources":["../../../src/dynamicFlow/stories/EditableDynamicFlow.tsx"],"names":[],"mappings":";;;;;;AAAA,2CAA2C;AAC3C,4DAAkD;AAClD,iCAAiC;AAEjC,6CAA0C;AAE1C,iEAAyC;AAEzC,qDAAkD;AAElD,MAAM,mBAAmB,GAAG,CAAC,EAAE,eAAe,GAAG,EAAE,EAAgC,EAAE,EAAE;IACrF,MAAM,YAAY,GAAG,mBAAQ,CAAC,KAAK,CAAC,eAA8C,CAAC,IAAI,EAAE,CAAC;IAC1F,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAClE,OAAO,uBAAC,eAAe,IAA2B,mBAAmB,EAAE,mBAAmB,IAA7D,mBAAmB,CAA8C,CAAC;AACjG,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,EAAE,mBAAmB,EAAmC,EAAE,EAAE;IACnF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,mBAAmB,CAAC,CAAC;IAEpE,MAAM,gBAAgB,GAAG,CAAC,KAAyD,EAAE,EAAE;QACrF,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC;IAE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AAE,yBAAyB;4BACnC,OAAO,EAAE,SAAS;yBACnB;wBACD;4BACE,IAAI,EAAE,WAAW;4BACjB,IAAI,EAAE,mLAAmL;yBAC1L;qBACF;iBACF;aACF;SACM,CAAC;KACX;AACH,CAAC;AAED,kBAAe,mBAAmB,CAAC"}
|
|
@@ -1,76 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 };
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fixtureFetcher = void 0;
|
|
4
|
+
const addon_actions_1 = require("@storybook/addon-actions");
|
|
5
|
+
const validators_1 = require("../../common/validators");
|
|
6
|
+
const fixtures_1 = require("../../fixtures");
|
|
7
|
+
const DynamicFlow_story_1 = require("./DynamicFlow.story");
|
|
8
|
+
const fixtureFetcher = async (input, init) => {
|
|
9
|
+
(0, addon_actions_1.action)('fixtureFetcher')(input, init);
|
|
10
|
+
const url = getURL(input);
|
|
11
|
+
if (url.pathname.startsWith('/steps/')) {
|
|
12
|
+
return respondWithFixture(fixtures_1.fixtures.steps, url, init);
|
|
47
13
|
}
|
|
14
|
+
if (url.pathname.startsWith('/responses/')) {
|
|
15
|
+
return respondWithFixture(fixtures_1.fixtures.responses, url, init);
|
|
16
|
+
}
|
|
17
|
+
if (url.pathname.startsWith('/validate')) {
|
|
18
|
+
return new Response(JSON.stringify({ message: 'Validation-async OK' }));
|
|
19
|
+
}
|
|
20
|
+
return new Response(null, { status: 404 });
|
|
48
21
|
};
|
|
49
|
-
exports.__esModule = true;
|
|
50
|
-
exports.fixtureFetcher = void 0;
|
|
51
|
-
var addon_actions_1 = require("@storybook/addon-actions");
|
|
52
|
-
var validators_1 = require("../../common/validators");
|
|
53
|
-
var fixtures_1 = require("../../fixtures");
|
|
54
|
-
var DynamicFlow_story_1 = require("./DynamicFlow.story");
|
|
55
|
-
var fixtureFetcher = function (input, init) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var url;
|
|
57
|
-
return __generator(this, function (_a) {
|
|
58
|
-
(0, addon_actions_1.action)('fixtureFetcher')(input, init);
|
|
59
|
-
url = getURL(input);
|
|
60
|
-
if (url.pathname.startsWith('/steps/')) {
|
|
61
|
-
return [2 /*return*/, respondWithFixture(fixtures_1.fixtures.steps, url, init)];
|
|
62
|
-
}
|
|
63
|
-
if (url.pathname.startsWith('/responses/')) {
|
|
64
|
-
return [2 /*return*/, respondWithFixture(fixtures_1.fixtures.responses, url, init)];
|
|
65
|
-
}
|
|
66
|
-
if (url.pathname.startsWith('/validate')) {
|
|
67
|
-
return [2 /*return*/, new Response(JSON.stringify({ message: 'Validation-async OK' }))];
|
|
68
|
-
}
|
|
69
|
-
return [2 /*return*/, new Response(null, { status: 404 })];
|
|
70
|
-
});
|
|
71
|
-
}); };
|
|
72
22
|
exports.fixtureFetcher = fixtureFetcher;
|
|
73
|
-
|
|
23
|
+
const getURL = (input) => {
|
|
74
24
|
if (input instanceof URL) {
|
|
75
25
|
return input;
|
|
76
26
|
}
|
|
@@ -79,40 +29,33 @@ var getURL = function (input) {
|
|
|
79
29
|
}
|
|
80
30
|
return new URL(input, 'http://foo');
|
|
81
31
|
};
|
|
82
|
-
|
|
83
|
-
var fixtureNames, name, fixture, body;
|
|
32
|
+
const respondWithFixture = async (fixtures, url, init) => {
|
|
84
33
|
var _a;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
(init === null || init === void 0 ? void 0 : init.body) &&
|
|
104
|
-
typeof init.body === 'string' &&
|
|
105
|
-
(0, validators_1.isObject)(fixture)) {
|
|
106
|
-
body = JSON.parse(init.body);
|
|
107
|
-
return [2 /*return*/, new Response(JSON.stringify(__assign(__assign({}, fixture), { model: __assign(__assign({}, ((_a = fixture.model) !== null && _a !== void 0 ? _a : {})), body) })))];
|
|
108
|
-
}
|
|
109
|
-
if (url.pathname.includes('exit')) {
|
|
110
|
-
return [2 /*return*/, new Response(JSON.stringify(fixture), { headers: { 'X-DF-Exit': 'true' } })];
|
|
111
|
-
}
|
|
112
|
-
return [2 /*return*/, new Response(JSON.stringify(fixture))];
|
|
113
|
-
case 3:
|
|
114
|
-
(0, addon_actions_1.action)('ERROR 404')(url);
|
|
115
|
-
return [2 /*return*/, new Response(null, { status: 404 })];
|
|
34
|
+
const fixtureNames = (0, DynamicFlow_story_1.getObjectKeys)(fixtures);
|
|
35
|
+
const name = url.pathname
|
|
36
|
+
.split('/')
|
|
37
|
+
.filter((part) => !!part)
|
|
38
|
+
.pop();
|
|
39
|
+
if (fixtureNames.includes(name !== null && name !== void 0 ? name : '')) {
|
|
40
|
+
const fixture = fixtures[name];
|
|
41
|
+
// by convention if the url contains a "delay" query parameter, we delay the response
|
|
42
|
+
if (url.searchParams.has('delay')) {
|
|
43
|
+
await new Promise((resolve) => setTimeout(resolve, Number(url.searchParams.get('delay'))));
|
|
44
|
+
}
|
|
45
|
+
// by convention if the url contains a "refresh"query parameterm we use the payload as model
|
|
46
|
+
if (url.searchParams.has('refresh') &&
|
|
47
|
+
(init === null || init === void 0 ? void 0 : init.body) &&
|
|
48
|
+
typeof init.body === 'string' &&
|
|
49
|
+
(0, validators_1.isObject)(fixture)) {
|
|
50
|
+
const body = JSON.parse(init.body);
|
|
51
|
+
return new Response(JSON.stringify(Object.assign(Object.assign({}, fixture), { model: Object.assign(Object.assign({}, ((_a = fixture.model) !== null && _a !== void 0 ? _a : {})), body) })));
|
|
116
52
|
}
|
|
117
|
-
|
|
118
|
-
|
|
53
|
+
if (url.pathname.includes('exit')) {
|
|
54
|
+
return new Response(JSON.stringify(fixture), { headers: { 'X-DF-Exit': 'true' } });
|
|
55
|
+
}
|
|
56
|
+
return new Response(JSON.stringify(fixture));
|
|
57
|
+
}
|
|
58
|
+
(0, addon_actions_1.action)('ERROR 404')(url);
|
|
59
|
+
return new Response(null, { status: 404 });
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=fixtureFetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtureFetcher.js","sourceRoot":"","sources":["../../../src/dynamicFlow/stories/fixtureFetcher.tsx"],"names":[],"mappings":";;;AAAA,4DAAkD;AAElD,wDAAmD;AACnD,6CAA0C;AAI1C,2DAAoD;AAE7C,MAAM,cAAc,GAAY,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAC3D,IAAA,sBAAM,EAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE1B,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QACtC,OAAO,kBAAkB,CAAC,mBAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;KACtD;IAED,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,E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6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
exports.__esModule = true;
|
|
18
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
var react_1 = require("react");
|
|
20
|
-
var ErrorBoundaryAlert_1 = require("./ErrorBoundaryAlert");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ErrorBoundaryAlert_1 = require("./ErrorBoundaryAlert");
|
|
21
6
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_this.setState({ hasError: false, isFatalError: false });
|
|
7
|
+
const noop = () => { };
|
|
8
|
+
class ErrorBoundary extends react_1.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.handleErrorReset = () => {
|
|
12
|
+
this.setState({ hasError: false, isFatalError: false });
|
|
29
13
|
};
|
|
30
|
-
|
|
31
|
-
return _this;
|
|
14
|
+
this.state = { hasError: false, isFatalError: false };
|
|
32
15
|
}
|
|
33
|
-
|
|
16
|
+
static getDerivedStateFromError() {
|
|
34
17
|
return { hasError: true, isFatalError: true };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
}
|
|
19
|
+
componentDidCatch(error) {
|
|
20
|
+
const { onError = noop } = this.props;
|
|
38
21
|
onError(error);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
const { children } = this.props;
|
|
25
|
+
const { hasError, isFatalError } = this.state;
|
|
43
26
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasError && (0, jsx_runtime_1.jsx)(ErrorBoundaryAlert_1.ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }), !isFatalError && children] }));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = ErrorBoundary;
|
|
30
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../../src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":";;;AAAA,iCAAkC;AAElC,6DAA0D;AAE1D,gEAAgE;AAChE,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAKtB,MAAM,aAAc,SAAQ,iBAAuB;IACjD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAC;QAaf,qBAAgB,GAAG,GAAG,EAAE;YACtB,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC;QAdA,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,wBAAwB;QAC7B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,KAAY;QAC5B,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAMD,MAAM;QACJ,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAChC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE9C,OAAO,CACL,6DACG,QAAQ,IAAI,uBAAC,uCAAkB,IAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,GAAI,EACpE,CAAC,YAAY,IAAI,QAAQ,IACzB,CACJ,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
5
|
errorAlert: {
|
|
6
6
|
id: 'dynamicFlows.ErrorBoundary.errorAlert',
|
|
7
7
|
defaultMessage: 'Oops. Something went wrong...',
|
|
8
|
-
description: 'Generic error message for when something has gone wrong'
|
|
8
|
+
description: 'Generic error message for when something has gone wrong',
|
|
9
9
|
},
|
|
10
10
|
retry: {
|
|
11
11
|
id: 'dynamicFlows.ErrorBoundary.retry',
|
|
12
12
|
defaultMessage: 'Retry',
|
|
13
|
-
description: 'Retry'
|
|
14
|
-
}
|
|
13
|
+
description: 'Retry',
|
|
14
|
+
},
|
|
15
15
|
});
|
|
16
|
+
//# sourceMappingURL=ErrorBoundary.messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.messages.js","sourceRoot":"","sources":["../../../../src/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.ts"],"names":[],"mappings":";;AAAA,2CAA4C;AAE5C,kBAAe,IAAA,2BAAc,EAAC;IAC5B,UAAU,EAAE;QACV,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,+BAA+B;QAC/C,WAAW,EAAE,yDAAyD;KACvE;IACD,KAAK,EAAE;QACL,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,OAAO;KACrB;CACF,CAAC,CAAC"}
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ErrorBoundaryAlert = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var formatMessage = (0, react_intl_1.useIntl)().formatMessage;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const components_1 = require("@transferwise/components");
|
|
9
|
+
const react_intl_1 = require("react-intl");
|
|
10
|
+
const ErrorBoundary_messages_1 = __importDefault(require("./ErrorBoundary.messages"));
|
|
11
|
+
const ErrorBoundaryAlert = ({ onDismiss }) => {
|
|
12
|
+
const { formatMessage } = (0, react_intl_1.useIntl)();
|
|
14
13
|
return ((0, jsx_runtime_1.jsx)(components_1.Alert, { action: {
|
|
15
|
-
text: formatMessage(ErrorBoundary_messages_1
|
|
16
|
-
href: window.location.href
|
|
17
|
-
}, message: formatMessage(ErrorBoundary_messages_1
|
|
14
|
+
text: formatMessage(ErrorBoundary_messages_1.default.retry),
|
|
15
|
+
href: window.location.href,
|
|
16
|
+
}, message: formatMessage(ErrorBoundary_messages_1.default.errorAlert), type: components_1.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: onDismiss }));
|
|
18
17
|
};
|
|
19
18
|
exports.ErrorBoundaryAlert = ErrorBoundaryAlert;
|
|
19
|
+
//# sourceMappingURL=ErrorBoundaryAlert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundaryAlert.js","sourceRoot":"","sources":["../../../../src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx"],"names":[],"mappings":";;;;;;;AAAA,yDAA4D;AAC5D,2CAAqC;AAErC,sFAAgD;AAIzC,MAAM,kBAAkB,GAAG,CAAC,EAAE,SAAS,EAAS,EAAE,EAAE;IACzD,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAC;IACpC,OAAO,CACL,uBAAC,kBAAK,IACJ,MAAM,EAAE;YACN,IAAI,EAAE,aAAa,CAAC,gCAAQ,CAAC,KAAK,CAAC;YACnC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI;SAC3B,EACD,OAAO,EAAE,aAAa,CAAC,gCAAQ,CAAC,UAAU,CAAC,EAC3C,IAAI,EAAE,sBAAS,CAAC,QAAQ,EACxB,SAAS,EAAC,OAAO,EACjB,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,kBAAkB,sBAc7B"}
|
|
@@ -13,11 +13,15 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
20
|
exports.ErrorBoundary = void 0;
|
|
18
21
|
__exportStar(require("./useDebouncedRefresh/useDebouncedRefresh"), exports);
|
|
19
22
|
__exportStar(require("./useDynamicFlowState"), exports);
|
|
20
23
|
__exportStar(require("./useLoader"), exports);
|
|
21
24
|
var ErrorBoundary_1 = require("./errorBoundary/ErrorBoundary");
|
|
22
|
-
|
|
25
|
+
Object.defineProperty(exports, "ErrorBoundary", { enumerable: true, get: function () { return __importDefault(ErrorBoundary_1).default; } });
|
|
23
26
|
__exportStar(require("./responseParsers/response-parsers"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dynamicFlow/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4EAA0D;AAC1D,wDAAsC;AACtC,8CAA4B;AAC5B,+DAAyE;AAAhE,+HAAA,OAAO,OAAiB;AACjC,qEAAmD"}
|