@wise/dynamic-flow-client 0.2.0 → 0.3.0-beta-d45b31.38
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/package.json +34 -32
- package/build/common/api/utils.d.ts +0 -4
- package/build/common/api/utils.js +0 -13
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.d.ts +0 -11
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.js +0 -36
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.d.ts +0 -4
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.js +0 -13
- package/build/common/contexts/fetcherContext/fetcherContext.d.ts +0 -18
- package/build/common/contexts/fetcherContext/fetcherContext.js +0 -35
- package/build/common/contexts/fetcherContext/index.d.ts +0 -2
- package/build/common/contexts/fetcherContext/index.js +0 -2
- package/build/common/contexts/fetcherContext/makeFetcher.d.ts +0 -2
- package/build/common/contexts/fetcherContext/makeFetcher.js +0 -33
- package/build/common/general/index.d.ts +0 -2
- package/build/common/general/index.js +0 -22
- package/build/common/hooks/useDebouncedFunction.d.ts +0 -2
- package/build/common/hooks/useDebouncedFunction.js +0 -9
- package/build/common/hooks/useDebouncedFunction.test.d.ts +0 -1
- package/build/common/hooks/useDebouncedFunction.test.js +0 -59
- package/build/common/hooks/usePersistAsync.d.ts +0 -7
- package/build/common/hooks/usePersistAsync.js +0 -170
- package/build/common/hooks/usePolling.d.ts +0 -11
- package/build/common/hooks/usePolling.js +0 -48
- package/build/common/hooks/usePrevious.d.ts +0 -2
- package/build/common/hooks/usePrevious.js +0 -9
- package/build/common/index.d.ts +0 -4
- package/build/common/index.js +0 -4
- package/build/common/logging/index.d.ts +0 -22
- package/build/common/logging/index.js +0 -39
- package/build/common/logging/spec.d.ts +0 -1
- package/build/common/logging/spec.js +0 -45
- package/build/common/messages.d.ts +0 -8
- package/build/common/messages.js +0 -8
- package/build/common/propsValues/dateMode.d.ts +0 -4
- package/build/common/propsValues/dateMode.js +0 -4
- package/build/common/propsValues/formControlType.d.ts +0 -17
- package/build/common/propsValues/formControlType.js +0 -17
- package/build/common/propsValues/monthFormat.d.ts +0 -4
- package/build/common/propsValues/monthFormat.js +0 -4
- package/build/common/propsValues/size.d.ts +0 -7
- package/build/common/propsValues/size.js +0 -7
- package/build/common/requirements.d.ts +0 -10
- package/build/common/requirements.js +0 -50
- package/build/common/schemaTypes/schemaTypes.d.ts +0 -23
- package/build/common/schemaTypes/schemaTypes.js +0 -53
- package/build/common/schemaTypes/shouldDebounceSchema.d.ts +0 -2
- package/build/common/schemaTypes/shouldDebounceSchema.js +0 -6
- package/build/common/stepTypes/stepTypes.d.ts +0 -7
- package/build/common/stepTypes/stepTypes.js +0 -42
- package/build/common/tracking/index.d.ts +0 -15
- package/build/common/tracking/index.js +0 -33
- package/build/common/tracking/spec.d.ts +0 -1
- package/build/common/tracking/spec.js +0 -49
- package/build/common/utils/file-utils.d.ts +0 -4
- package/build/common/utils/file-utils.js +0 -45
- package/build/common/utils/generate-random-id.d.ts +0 -1
- package/build/common/utils/generate-random-id.js +0 -5
- package/build/common/utils/generate-random-id.test.d.ts +0 -1
- package/build/common/utils/generate-random-id.test.js +0 -12
- package/build/common/validation/rule-validators/index.d.ts +0 -10
- package/build/common/validation/rule-validators/index.js +0 -40
- package/build/common/validation/rule-validators/spec.d.ts +0 -1
- package/build/common/validation/rule-validators/spec.js +0 -145
- package/build/common/validation/schema-validators/index.d.ts +0 -9
- package/build/common/validation/schema-validators/index.js +0 -98
- package/build/common/validation/schema-validators/spec.d.ts +0 -1
- package/build/common/validation/schema-validators/spec.js +0 -137
- package/build/common/validation/valid-model/index.d.ts +0 -5
- package/build/common/validation/valid-model/index.js +0 -64
- package/build/common/validation/valid-model/spec.d.ts +0 -1
- package/build/common/validation/valid-model/spec.js +0 -605
- package/build/common/validation/valid-model/utils.d.ts +0 -11
- package/build/common/validation/valid-model/utils.js +0 -118
- package/build/common/validation/validation-failures/index.d.ts +0 -23
- package/build/common/validation/validation-failures/index.js +0 -140
- package/build/common/validation/validation-failures/spec.d.ts +0 -1
- package/build/common/validation/validation-failures/spec.js +0 -185
- package/build/dynamic-flow-types/Action.d.ts +0 -19
- package/build/dynamic-flow-types/Action.js +0 -1
- package/build/dynamic-flow-types/FileUploadSchema.d.ts +0 -23
- package/build/dynamic-flow-types/FileUploadSchema.js +0 -3
- package/build/dynamic-flow-types/LayoutComponent.d.ts +0 -129
- package/build/dynamic-flow-types/LayoutComponent.js +0 -1
- package/build/dynamic-flow-types/Model.d.ts +0 -12
- package/build/dynamic-flow-types/Model.js +0 -28
- package/build/dynamic-flow-types/PersistAsync.d.ts +0 -8
- package/build/dynamic-flow-types/PersistAsync.js +0 -1
- package/build/dynamic-flow-types/Polling.d.ts +0 -12
- package/build/dynamic-flow-types/Polling.js +0 -1
- package/build/dynamic-flow-types/Promotion.d.ts +0 -20
- package/build/dynamic-flow-types/Promotion.js +0 -1
- package/build/dynamic-flow-types/Schema.d.ts +0 -184
- package/build/dynamic-flow-types/Schema.js +0 -49
- package/build/dynamic-flow-types/Step.d.ts +0 -127
- package/build/dynamic-flow-types/Step.js +0 -4
- package/build/dynamic-flow-types/ValidationAsync.d.ts +0 -6
- package/build/dynamic-flow-types/ValidationAsync.js +0 -1
- package/build/dynamic-flow-types/core.d.ts +0 -29
- package/build/dynamic-flow-types/core.js +0 -1
- package/build/dynamic-flow-types/index.d.ts +0 -14
- package/build/dynamic-flow-types/index.js +0 -12
- package/build/field/Field.d.ts +0 -69
- package/build/field/Field.js +0 -311
- package/build/field/index.d.ts +0 -2
- package/build/field/index.js +0 -2
- package/build/flow/DynamicFlow.d.ts +0 -3
- package/build/flow/DynamicFlow.js +0 -368
- package/build/flow/DynamicFlowStep.d.ts +0 -8
- package/build/flow/DynamicFlowStep.js +0 -32
- package/build/flow/errorBoundary/ErrorBoundary.d.ts +0 -20
- package/build/flow/errorBoundary/ErrorBoundary.js +0 -45
- package/build/flow/errorBoundary/ErrorBoundary.messages.d.ts +0 -13
- package/build/flow/errorBoundary/ErrorBoundary.messages.js +0 -13
- package/build/flow/errorBoundary/ErrorBoundaryAlert.d.ts +0 -5
- package/build/flow/errorBoundary/ErrorBoundaryAlert.js +0 -12
- package/build/flow/errorBoundary/index.d.ts +0 -1
- package/build/flow/errorBoundary/index.js +0 -1
- package/build/flow/fixtures/components/alert.d.ts +0 -3
- package/build/flow/fixtures/components/alert.js +0 -31
- package/build/flow/fixtures/components/box.d.ts +0 -3
- package/build/flow/fixtures/components/box.js +0 -20
- package/build/flow/fixtures/components/button.d.ts +0 -3
- package/build/flow/fixtures/components/button.js +0 -65
- package/build/flow/fixtures/components/columns.d.ts +0 -3
- package/build/flow/fixtures/components/columns.js +0 -36
- package/build/flow/fixtures/components/copyable.d.ts +0 -3
- package/build/flow/fixtures/components/copyable.js +0 -22
- package/build/flow/fixtures/components/decision.d.ts +0 -3
- package/build/flow/fixtures/components/decision.js +0 -54
- package/build/flow/fixtures/components/heading.d.ts +0 -3
- package/build/flow/fixtures/components/heading.js +0 -14
- package/build/flow/fixtures/components/image.d.ts +0 -3
- package/build/flow/fixtures/components/image.js +0 -22
- package/build/flow/fixtures/components/info.d.ts +0 -3
- package/build/flow/fixtures/components/info.js +0 -17
- package/build/flow/fixtures/components/list.d.ts +0 -3
- package/build/flow/fixtures/components/list.js +0 -34
- package/build/flow/fixtures/components/loading-indicator.d.ts +0 -3
- package/build/flow/fixtures/components/loading-indicator.js +0 -16
- package/build/flow/fixtures/components/paragraph.d.ts +0 -3
- package/build/flow/fixtures/components/paragraph.js +0 -28
- package/build/flow/fixtures/components/review.d.ts +0 -3
- package/build/flow/fixtures/components/review.js +0 -60
- package/build/flow/fixtures/examples/camera-capture.d.ts +0 -3
- package/build/flow/fixtures/examples/camera-capture.js +0 -121
- package/build/flow/fixtures/examples/recipient-update.d.ts +0 -3
- package/build/flow/fixtures/examples/recipient-update.js +0 -250
- package/build/flow/fixtures/examples/recipient.d.ts +0 -3
- package/build/flow/fixtures/examples/recipient.js +0 -313
- package/build/flow/fixtures/examples/single-file-upload.d.ts +0 -3
- package/build/flow/fixtures/examples/single-file-upload.js +0 -96
- package/build/flow/fixtures/examples/step-validation-errors.d.ts +0 -3
- package/build/flow/fixtures/examples/step-validation-errors.js +0 -75
- package/build/flow/fixtures/features/action-response.d.ts +0 -3
- package/build/flow/fixtures/features/action-response.js +0 -29
- package/build/flow/fixtures/features/external.d.ts +0 -3
- package/build/flow/fixtures/features/external.js +0 -31
- package/build/flow/fixtures/features/persist-async.d.ts +0 -3
- package/build/flow/fixtures/features/persist-async.js +0 -44
- package/build/flow/fixtures/features/polling.d.ts +0 -3
- package/build/flow/fixtures/features/polling.js +0 -33
- package/build/flow/fixtures/index.d.ts +0 -42
- package/build/flow/fixtures/index.js +0 -66
- package/build/flow/fixtures/responses/action-response-final.d.ts +0 -3
- package/build/flow/fixtures/responses/action-response-final.js +0 -24
- package/build/flow/fixtures/responses/action.d.ts +0 -5
- package/build/flow/fixtures/responses/action.js +0 -2
- package/build/flow/fixtures/responses/exit.d.ts +0 -6
- package/build/flow/fixtures/responses/exit.js +0 -2
- package/build/flow/fixtures/responses/recipient-update-final.d.ts +0 -3
- package/build/flow/fixtures/responses/recipient-update-final.js +0 -24
- package/build/flow/fixtures/schemas/basic-form.d.ts +0 -3
- package/build/flow/fixtures/schemas/basic-form.js +0 -39
- package/build/flow/fixtures/schemas/number-and-integer.d.ts +0 -3
- package/build/flow/fixtures/schemas/number-and-integer.js +0 -41
- package/build/flow/fixtures/schemas/one-of.d.ts +0 -3
- package/build/flow/fixtures/schemas/one-of.js +0 -223
- package/build/flow/fixtures/schemas/string-formats.d.ts +0 -3
- package/build/flow/fixtures/schemas/string-formats.js +0 -58
- package/build/flow/index.d.ts +0 -1
- package/build/flow/index.js +0 -1
- package/build/flow/response-parsers/index.d.ts +0 -17
- package/build/flow/response-parsers/index.js +0 -112
- package/build/flow/response-parsers/spec.d.ts +0 -1
- package/build/flow/response-parsers/spec.js +0 -263
- package/build/flow/stories/EditableDynamicFlow.d.ts +0 -4
- package/build/flow/stories/EditableDynamicFlow.js +0 -61
- package/build/flow/types.d.ts +0 -77
- package/build/flow/types.js +0 -3
- package/build/flow/useDebouncedRefresh/index.d.ts +0 -1
- package/build/flow/useDebouncedRefresh/index.js +0 -1
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.d.ts +0 -5
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.js +0 -24
- package/build/flow/useDynamicFlowState.d.ts +0 -18
- package/build/flow/useDynamicFlowState.js +0 -111
- package/build/flow/useLoader.d.ts +0 -9
- package/build/flow/useLoader.js +0 -22
- package/build/formControl/FormControl.d.ts +0 -86
- package/build/formControl/FormControl.js +0 -241
- package/build/formControl/index.d.ts +0 -1
- package/build/formControl/index.js +0 -1
- package/build/formControl/types.d.ts +0 -57
- package/build/formControl/types.js +0 -1
- package/build/formControl/value-utils.d.ts +0 -9
- package/build/formControl/value-utils.js +0 -108
- package/build/i18n/cs.json +0 -8
- package/build/i18n/de.json +0 -34
- package/build/i18n/en.json +0 -38
- package/build/i18n/es.json +0 -34
- package/build/i18n/fr.json +0 -34
- package/build/i18n/hu.json +0 -34
- package/build/i18n/id.json +0 -34
- package/build/i18n/index.d.ts +0 -2
- package/build/i18n/index.js +0 -31
- package/build/i18n/it.json +0 -34
- package/build/i18n/ja.json +0 -34
- package/build/i18n/pl.json +0 -11
- package/build/i18n/pt.json +0 -34
- package/build/i18n/ro.json +0 -34
- package/build/i18n/ru.json +0 -34
- package/build/i18n/th.json +0 -34
- package/build/i18n/tr.json +0 -11
- package/build/i18n/uk.json +0 -8
- package/build/i18n/zh-CN.json +0 -34
- package/build/i18n/zh.json +0 -34
- package/build/index.d.ts +0 -12
- package/build/index.js +0 -11
- package/build/jsonSchemaForm/JsonSchemaForm.d.ts +0 -65
- package/build/jsonSchemaForm/JsonSchemaForm.js +0 -31
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +0 -13
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +0 -54
- package/build/jsonSchemaForm/allOfSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/allOfSchema/index.js +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +0 -14
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +0 -25
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +0 -15
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +0 -26
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.d.ts +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +0 -17
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +0 -141
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +0 -24
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +0 -18
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +0 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.d.ts +0 -9
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.js +0 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.d.ts +0 -6
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.js +0 -85
- package/build/jsonSchemaForm/arrayTypeSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +0 -1
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +0 -21
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +0 -105
- package/build/jsonSchemaForm/basicTypeSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/basicTypeSchema/index.js +0 -1
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +0 -30
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +0 -79
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts +0 -53
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +0 -53
- package/build/jsonSchemaForm/controlFeedback/index.d.ts +0 -1
- package/build/jsonSchemaForm/controlFeedback/index.js +0 -1
- package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +0 -18
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +0 -122
- package/build/jsonSchemaForm/genericSchema/index.d.ts +0 -1
- package/build/jsonSchemaForm/genericSchema/index.js +0 -1
- package/build/jsonSchemaForm/help/Help.d.ts +0 -7
- package/build/jsonSchemaForm/help/Help.js +0 -9
- package/build/jsonSchemaForm/help/Help.messages.d.ts +0 -8
- package/build/jsonSchemaForm/help/Help.messages.js +0 -8
- package/build/jsonSchemaForm/help/index.d.ts +0 -1
- package/build/jsonSchemaForm/help/index.js +0 -1
- package/build/jsonSchemaForm/index.d.ts +0 -1
- package/build/jsonSchemaForm/index.js +0 -1
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +0 -15
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +0 -78
- package/build/jsonSchemaForm/objectSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/objectSchema/index.js +0 -1
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +0 -14
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +0 -153
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.d.ts +0 -3
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.js +0 -40
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.d.ts +0 -2
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.js +0 -27
- package/build/jsonSchemaForm/oneOfSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/oneOfSchema/index.js +0 -1
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.d.ts +0 -3
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.js +0 -7
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +0 -15
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +0 -26
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +0 -8
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +0 -8
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.d.ts +0 -20
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.js +0 -168
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.d.ts +0 -1
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.js +0 -1
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.d.ts +0 -19
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.js +0 -127
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.d.ts +0 -16
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.js +0 -32
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.d.ts +0 -1
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.js +0 -1
- package/build/jsonSchemaForm/persistAsyncSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +0 -1
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +0 -8
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +0 -72
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.d.ts +0 -2
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.js +0 -8
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.d.ts +0 -6
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.js +0 -27
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.d.ts +0 -23
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.js +0 -31
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.d.ts +0 -8
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.js +0 -32
- package/build/jsonSchemaForm/promotedOneOfSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +0 -1
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +0 -7
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +0 -55
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +0 -16
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +0 -13
- package/build/jsonSchemaForm/readOnlySchema/index.d.ts +0 -1
- package/build/jsonSchemaForm/readOnlySchema/index.js +0 -1
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +0 -24
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +0 -106
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.d.ts +0 -3
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.js +0 -73
- package/build/jsonSchemaForm/schemaFormControl/index.d.ts +0 -1
- package/build/jsonSchemaForm/schemaFormControl/index.js +0 -1
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.d.ts +0 -39
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.js +0 -89
- package/build/jsonSchemaForm/schemas/allOf.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/allOf.json.js +0 -119
- package/build/jsonSchemaForm/schemas/audRecipient.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/audRecipient.json.js +0 -1104
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.js +0 -37
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.js +0 -36
- package/build/jsonSchemaForm/schemas/currency.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/currency.json.js +0 -48
- package/build/jsonSchemaForm/schemas/oneOf.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/oneOf.json.js +0 -119
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.js +0 -53
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.js +0 -56
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.js +0 -102
- package/build/jsonSchemaForm/schemas/simple.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/simple.json.js +0 -48
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.js +0 -71
- package/build/jsonSchemaForm/schemas/validationAsync.json.d.ts +0 -3
- package/build/jsonSchemaForm/schemas/validationAsync.json.js +0 -23
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +0 -16
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +0 -149
- package/build/jsonSchemaForm/validationAsyncSchema/index.d.ts +0 -2
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +0 -1
- package/build/layout/DynamicLayout.d.ts +0 -16
- package/build/layout/DynamicLayout.js +0 -75
- package/build/layout/alert/index.d.ts +0 -5
- package/build/layout/alert/index.js +0 -29
- package/build/layout/box/index.d.ts +0 -7
- package/build/layout/box/index.js +0 -41
- package/build/layout/button/index.d.ts +0 -7
- package/build/layout/button/index.js +0 -58
- package/build/layout/columns/index.d.ts +0 -7
- package/build/layout/columns/index.js +0 -38
- package/build/layout/decision/index.d.ts +0 -8
- package/build/layout/decision/index.js +0 -38
- package/build/layout/divider/index.d.ts +0 -6
- package/build/layout/divider/index.js +0 -9
- package/build/layout/external/DynamicExternal.d.ts +0 -7
- package/build/layout/external/DynamicExternal.js +0 -30
- package/build/layout/external/DynamicExternal.messages.d.ts +0 -8
- package/build/layout/external/DynamicExternal.messages.js +0 -8
- package/build/layout/external/index.d.ts +0 -1
- package/build/layout/external/index.js +0 -1
- package/build/layout/external/useExternalStepPolling.d.ts +0 -11
- package/build/layout/external/useExternalStepPolling.js +0 -68
- package/build/layout/form/index.d.ts +0 -7
- package/build/layout/form/index.js +0 -22
- package/build/layout/heading/index.d.ts +0 -5
- package/build/layout/heading/index.js +0 -31
- package/build/layout/icon/index.d.ts +0 -6
- package/build/layout/icon/index.js +0 -22
- package/build/layout/image/index.d.ts +0 -5
- package/build/layout/image/index.js +0 -126
- package/build/layout/index.d.ts +0 -1
- package/build/layout/index.js +0 -1
- package/build/layout/info/index.d.ts +0 -6
- package/build/layout/info/index.js +0 -19
- package/build/layout/layouts/all.json.d.ts +0 -3
- package/build/layout/layouts/all.json.js +0 -176
- package/build/layout/layouts/final-step-layout.json.d.ts +0 -3
- package/build/layout/layouts/final-step-layout.json.js +0 -39
- package/build/layout/layouts/finalStep.json.d.ts +0 -3
- package/build/layout/layouts/finalStep.json.js +0 -24
- package/build/layout/layouts/list.json.d.ts +0 -3
- package/build/layout/layouts/list.json.js +0 -33
- package/build/layout/layouts/pay-in.json.d.ts +0 -3
- package/build/layout/layouts/pay-in.json.js +0 -97
- package/build/layout/layouts/review.json.d.ts +0 -3
- package/build/layout/layouts/review.json.js +0 -160
- package/build/layout/layouts/success.json.d.ts +0 -3
- package/build/layout/layouts/success.json.js +0 -66
- package/build/layout/list/index.d.ts +0 -7
- package/build/layout/list/index.js +0 -30
- package/build/layout/loading-indicator/index.d.ts +0 -6
- package/build/layout/loading-indicator/index.js +0 -10
- package/build/layout/loading-indicator/spec.d.ts +0 -1
- package/build/layout/loading-indicator/spec.js +0 -11
- package/build/layout/paragraph/DynamicParagraph.d.ts +0 -6
- package/build/layout/paragraph/DynamicParagraph.js +0 -42
- package/build/layout/paragraph/DynamicParagraph.messages.d.ts +0 -13
- package/build/layout/paragraph/DynamicParagraph.messages.js +0 -13
- package/build/layout/paragraph/index.d.ts +0 -1
- package/build/layout/paragraph/index.js +0 -1
- package/build/layout/paragraph/useSnackBarIfAvailable.d.ts +0 -10
- package/build/layout/paragraph/useSnackBarIfAvailable.js +0 -9
- package/build/layout/review/index.d.ts +0 -8
- package/build/layout/review/index.js +0 -33
- package/build/layout/utils.d.ts +0 -7
- package/build/layout/utils.js +0 -31
- package/build/main.css +0 -143
- package/build/schema.d.ts +0 -1
- package/build/schema.js +0 -1
- package/build/step/cameraStep/CameraStep.d.ts +0 -7
- package/build/step/cameraStep/CameraStep.js +0 -125
- package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +0 -15
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +0 -122
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +0 -18
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +0 -18
- package/build/step/cameraStep/cameraCapture/components/index.d.ts +0 -7
- package/build/step/cameraStep/cameraCapture/components/index.js +0 -28
- package/build/step/cameraStep/cameraCapture/hooks/index.d.ts +0 -4
- package/build/step/cameraStep/cameraCapture/hooks/index.js +0 -80
- package/build/step/cameraStep/cameraCapture/index.d.ts +0 -1
- package/build/step/cameraStep/cameraCapture/index.js +0 -1
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +0 -10
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +0 -78
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +0 -2
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +0 -19
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +0 -13
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +0 -13
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +0 -5
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +0 -21
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +0 -18
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +0 -18
- package/build/step/cameraStep/cameraCapture/screens/index.d.ts +0 -2
- package/build/step/cameraStep/cameraCapture/screens/index.js +0 -2
- package/build/step/cameraStep/cameraCapture/tracking/index.d.ts +0 -7
- package/build/step/cameraStep/cameraCapture/tracking/index.js +0 -101
- package/build/step/cameraStep/cameraCapture/utils/index.d.ts +0 -8
- package/build/step/cameraStep/cameraCapture/utils/index.js +0 -103
- package/build/step/cameraStep/index.d.ts +0 -1
- package/build/step/cameraStep/index.js +0 -1
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +0 -6
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +0 -64
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +0 -23
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +0 -23
- package/build/step/externalConfirmationStep/index.d.ts +0 -1
- package/build/step/externalConfirmationStep/index.js +0 -1
- package/build/step/features/external/useExternal.d.ts +0 -4
- package/build/step/features/external/useExternal.js +0 -15
- package/build/step/features/index.d.ts +0 -2
- package/build/step/features/index.js +0 -2
- package/build/step/features/polling/useStepPolling.d.ts +0 -2
- package/build/step/features/polling/useStepPolling.js +0 -44
- package/build/step/index.d.ts +0 -3
- package/build/step/index.js +0 -3
- package/build/step/layoutStep/LayoutStep.d.ts +0 -10
- package/build/step/layoutStep/LayoutStep.js +0 -34
- package/build/step/layoutStep/index.d.ts +0 -1
- package/build/step/layoutStep/index.js +0 -1
- package/build/step/layoutStep/layoutService/convertStepToLayout.d.ts +0 -8
- package/build/step/layoutStep/layoutService/convertStepToLayout.js +0 -217
- package/build/step/layoutStep/layoutService/index.d.ts +0 -2
- package/build/step/layoutStep/layoutService/index.js +0 -2
- package/build/step/layoutStep/layoutService/inlineReferences.d.ts +0 -7
- package/build/step/layoutStep/layoutService/inlineReferences.js +0 -91
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo } from 'react';
|
|
2
|
-
import { useFetcher } from '../../../common/contexts/fetcherContext';
|
|
3
|
-
import { usePolling } from '../../../common/hooks/usePolling';
|
|
4
|
-
export function useStepPolling(polling, onAction) {
|
|
5
|
-
var fetcher = useFetcher();
|
|
6
|
-
var asyncFn = useMemo(function () {
|
|
7
|
-
if (polling) {
|
|
8
|
-
return function () {
|
|
9
|
-
return fetcher(polling.url).then(function (response) {
|
|
10
|
-
if (response.ok) {
|
|
11
|
-
return response
|
|
12
|
-
.json()
|
|
13
|
-
.then(function (pollingResponse) { return pollingResponse; })["catch"](function (error) { return null; });
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
throw new Error('failed');
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
}, [polling, fetcher]);
|
|
25
|
-
var onPollingResponse = useCallback(function (pollingResponse) {
|
|
26
|
-
if (pollingResponse === null || pollingResponse === void 0 ? void 0 : pollingResponse.action) {
|
|
27
|
-
onAction(pollingResponse.action);
|
|
28
|
-
return false; // stop polling
|
|
29
|
-
}
|
|
30
|
-
return true; // continue polling
|
|
31
|
-
}, [onAction]);
|
|
32
|
-
usePolling({
|
|
33
|
-
asyncFn: asyncFn,
|
|
34
|
-
interval: 1000 * ((polling === null || polling === void 0 ? void 0 : polling.interval) || 0),
|
|
35
|
-
maxAttempts: (polling === null || polling === void 0 ? void 0 : polling.maxAttempts) || 0,
|
|
36
|
-
maxConsecutiveFails: 1,
|
|
37
|
-
onPollingResponse: onPollingResponse,
|
|
38
|
-
onFailure: useCallback(function () {
|
|
39
|
-
if (polling) {
|
|
40
|
-
onAction(polling.onError.action);
|
|
41
|
-
}
|
|
42
|
-
}, [onAction, polling])
|
|
43
|
-
});
|
|
44
|
-
}
|
package/build/step/index.d.ts
DELETED
package/build/step/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FormErrors, Step } from '../../dynamic-flow-types';
|
|
2
|
-
import { CommonLayoutProps } from '../../layout/DynamicLayout';
|
|
3
|
-
import { StepLayoutOptions } from './layoutService/convertStepToLayout';
|
|
4
|
-
export type LayoutStepProps = Omit<CommonLayoutProps, 'errors' | 'onPersistAsync'> & {
|
|
5
|
-
stepSpecification: Step;
|
|
6
|
-
stepLayoutOptions: StepLayoutOptions;
|
|
7
|
-
formErrors: FormErrors;
|
|
8
|
-
};
|
|
9
|
-
declare const LayoutStep: (props: LayoutStepProps) => JSX.Element;
|
|
10
|
-
export default LayoutStep;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isEmpty } from '@transferwise/neptune-validation';
|
|
3
|
-
import { useDynamicFlow } from '../../common/contexts/dynamicFlowContext/dynamicFlowContext';
|
|
4
|
-
import { useTracking } from '../../common/tracking';
|
|
5
|
-
import DynamicLayout from '../../layout';
|
|
6
|
-
import { useStepPolling } from '../features';
|
|
7
|
-
import { convertStepToLayout, inlineReferences } from './layoutService';
|
|
8
|
-
var getComponents = function (step, options) {
|
|
9
|
-
var _a;
|
|
10
|
-
if (!step || isEmpty(step) || (!step.layout && !step.type)) {
|
|
11
|
-
return [];
|
|
12
|
-
}
|
|
13
|
-
var layout = convertStepToLayout(step, options);
|
|
14
|
-
return inlineReferences({
|
|
15
|
-
layout: layout,
|
|
16
|
-
schemas: step.schemas || [],
|
|
17
|
-
actions: step.actions || [],
|
|
18
|
-
model: (_a = step.model) !== null && _a !== void 0 ? _a : null
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var LayoutStep = function (props) {
|
|
22
|
-
var stepSpecification = props.stepSpecification, stepLayoutOptions = props.stepLayoutOptions, submitted = props.submitted, model = props.model, formErrors = props.formErrors, onModelChange = props.onModelChange;
|
|
23
|
-
var components = getComponents(stepSpecification, stepLayoutOptions);
|
|
24
|
-
var _a = useDynamicFlow(), loading = _a.loading, registerPersistAsyncPromise = _a.registerPersistAsyncPromise;
|
|
25
|
-
var trackEvent = useTracking();
|
|
26
|
-
var onAction = !loading
|
|
27
|
-
? props.onAction
|
|
28
|
-
: function () {
|
|
29
|
-
trackEvent('Dynamic Flow - onAction supressed', { reason: 'LayoutStep - loading state' });
|
|
30
|
-
};
|
|
31
|
-
useStepPolling(stepSpecification.polling, onAction);
|
|
32
|
-
return (_jsx(DynamicLayout, { components: components, submitted: submitted, model: model, errors: formErrors, onAction: onAction, onModelChange: onModelChange, onPersistAsync: registerPersistAsyncPromise }));
|
|
33
|
-
};
|
|
34
|
-
export default LayoutStep;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './LayoutStep';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './LayoutStep';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Step, ButtonLayout, Action, LayoutComponent } from '../../../dynamic-flow-types';
|
|
2
|
-
export type StepLayoutOptions = {
|
|
3
|
-
displayStepTitle: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare function convertStepToLayout(step: Step, { displayStepTitle }?: {
|
|
6
|
-
displayStepTitle?: boolean | undefined;
|
|
7
|
-
}): LayoutComponent[];
|
|
8
|
-
export declare function convertStepActionToDynamicAction(action: Action): ButtonLayout;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
export function convertStepToLayout(step, _a) {
|
|
22
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.displayStepTitle, displayStepTitle = _c === void 0 ? true : _c;
|
|
23
|
-
if (!step || !step.type) {
|
|
24
|
-
throw new Error('Missing step type');
|
|
25
|
-
}
|
|
26
|
-
// This condition is meant as a temporary hack until mobile platforms will be refactored to fully support the layout property
|
|
27
|
-
if (step.layout) {
|
|
28
|
-
return addMissingTitleAndDescriptionToStep(step, displayStepTitle);
|
|
29
|
-
}
|
|
30
|
-
switch (step.type) {
|
|
31
|
-
case 'final':
|
|
32
|
-
return convertFinalStepToDynamicLayout(step);
|
|
33
|
-
case 'decision':
|
|
34
|
-
return convertDecisionStepToDynamicLayout(step);
|
|
35
|
-
case 'form':
|
|
36
|
-
return convertFormStepToDynamicLayout(step);
|
|
37
|
-
case 'external':
|
|
38
|
-
return convertExternalStepToDynamicLayout(step);
|
|
39
|
-
default:
|
|
40
|
-
throw new Error('invalid step type');
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function convertCommonComponents(step) {
|
|
44
|
-
var layout = [];
|
|
45
|
-
if (step.title) {
|
|
46
|
-
layout.push(convertStepTitleToDynamicHeading(step.title));
|
|
47
|
-
}
|
|
48
|
-
if (step.image) {
|
|
49
|
-
var image = convertStepImageToDynamicImage(step.image);
|
|
50
|
-
layout.push(image);
|
|
51
|
-
}
|
|
52
|
-
if (step.description) {
|
|
53
|
-
layout.push(convertStepDescriptionToDynamicParagraph(step.description));
|
|
54
|
-
}
|
|
55
|
-
return layout;
|
|
56
|
-
}
|
|
57
|
-
function convertExternalStepToDynamicLayout(step) {
|
|
58
|
-
return __spreadArray(__spreadArray([], convertCommonComponents(step), true), [convertStepToExternalComponent(step)], false);
|
|
59
|
-
}
|
|
60
|
-
function convertStepToExternalComponent(step) {
|
|
61
|
-
return {
|
|
62
|
-
type: 'external',
|
|
63
|
-
requestUrl: step.requestUrl,
|
|
64
|
-
polling: step.polling,
|
|
65
|
-
responseHandlers: step.responseHandlers,
|
|
66
|
-
retryTitle: step.retryTitle
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function convertFormStepToDynamicLayout(step) {
|
|
70
|
-
var layout = convertCommonComponents(step);
|
|
71
|
-
if (step.reviewFields) {
|
|
72
|
-
layout.push(convertStepReviewToDynamicReview(step.reviewFields));
|
|
73
|
-
}
|
|
74
|
-
if (step.schemas) {
|
|
75
|
-
layout.push.apply(layout, getSchemaLayout(step));
|
|
76
|
-
}
|
|
77
|
-
if (step.actions) {
|
|
78
|
-
var actions = step.actions.map(convertStepActionToDynamicAction);
|
|
79
|
-
layout.push(dynamicBox(actions, 'md'));
|
|
80
|
-
}
|
|
81
|
-
return layout;
|
|
82
|
-
}
|
|
83
|
-
function convertFinalStepToDynamicLayout(step) {
|
|
84
|
-
var layout = [];
|
|
85
|
-
if (step.details) {
|
|
86
|
-
if (step.details.image) {
|
|
87
|
-
var image = convertFinalStepImageToDynamicImage(step.details.image);
|
|
88
|
-
layout.push(image);
|
|
89
|
-
}
|
|
90
|
-
if (step.details.title) {
|
|
91
|
-
layout.push(convertStepTitleToDynamicHeading(step.details.title));
|
|
92
|
-
}
|
|
93
|
-
if (step.details.description) {
|
|
94
|
-
layout.push(convertStepDescriptionToDynamicParagraph(step.details.description));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (step.actions) {
|
|
98
|
-
var actions = step.actions.map(function (action) {
|
|
99
|
-
return convertStepActionToDynamicAction(__assign(__assign({}, action), { type: action.type || 'primary' }));
|
|
100
|
-
});
|
|
101
|
-
layout.push(dynamicBox(actions, 'md'));
|
|
102
|
-
}
|
|
103
|
-
return layout;
|
|
104
|
-
}
|
|
105
|
-
function convertDecisionStepToDynamicLayout(step) {
|
|
106
|
-
var layout = convertCommonComponents(step);
|
|
107
|
-
if (step.options) {
|
|
108
|
-
layout.push(convertStepDecisionToDynamicDecision(step.options));
|
|
109
|
-
}
|
|
110
|
-
return layout;
|
|
111
|
-
}
|
|
112
|
-
function dynamicBox(components, size) {
|
|
113
|
-
return {
|
|
114
|
-
type: 'box',
|
|
115
|
-
width: size || 'md',
|
|
116
|
-
components: components
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function convertStepTitleToDynamicHeading(title) {
|
|
120
|
-
return {
|
|
121
|
-
type: 'heading',
|
|
122
|
-
text: title,
|
|
123
|
-
size: 'lg',
|
|
124
|
-
margin: 'lg',
|
|
125
|
-
align: 'center'
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function convertStepDescriptionToDynamicParagraph(description) {
|
|
129
|
-
return {
|
|
130
|
-
type: 'paragraph',
|
|
131
|
-
text: description,
|
|
132
|
-
align: 'center'
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
function convertStepSchemaToDynamicForm(schema) {
|
|
136
|
-
return { type: 'form', schema: schema };
|
|
137
|
-
}
|
|
138
|
-
function convertStepDecisionToDynamicDecision(options) {
|
|
139
|
-
return {
|
|
140
|
-
type: 'decision',
|
|
141
|
-
options: options.map(convertStepDecisionOption)
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function convertStepDecisionOption(option) {
|
|
145
|
-
return {
|
|
146
|
-
title: option.title,
|
|
147
|
-
description: option.description,
|
|
148
|
-
action: {
|
|
149
|
-
title: option.title,
|
|
150
|
-
method: 'GET',
|
|
151
|
-
url: option.url,
|
|
152
|
-
disabled: option.disabled
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
function convertStepImageToDynamicImage(image) {
|
|
157
|
-
return {
|
|
158
|
-
type: 'image',
|
|
159
|
-
url: image.url,
|
|
160
|
-
text: image.text,
|
|
161
|
-
margin: image.margin || 'lg',
|
|
162
|
-
size: image.size || 'md'
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function convertFinalStepImageToDynamicImage(image) {
|
|
166
|
-
return typeof image === 'string'
|
|
167
|
-
? {
|
|
168
|
-
type: 'image',
|
|
169
|
-
url: image,
|
|
170
|
-
text: undefined,
|
|
171
|
-
margin: 'lg',
|
|
172
|
-
size: 'md'
|
|
173
|
-
}
|
|
174
|
-
: convertStepImageToDynamicImage(image);
|
|
175
|
-
}
|
|
176
|
-
export function convertStepActionToDynamicAction(action) {
|
|
177
|
-
var newAction = __assign(__assign({}, action), { title: action.title });
|
|
178
|
-
return {
|
|
179
|
-
type: 'button',
|
|
180
|
-
action: newAction
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
function convertStepReviewToDynamicReview(reviewFields) {
|
|
184
|
-
return {
|
|
185
|
-
type: 'review',
|
|
186
|
-
title: reviewFields.title,
|
|
187
|
-
fields: reviewFields.fields.map(convertReviewFieldToDefinition)
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
function convertReviewFieldToDefinition(reviewField) {
|
|
191
|
-
return {
|
|
192
|
-
label: reviewField.title,
|
|
193
|
-
value: reviewField.value
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
function getSchemaLayout(step) {
|
|
197
|
-
var layout = [];
|
|
198
|
-
if (step.schemas && step.schemas[0]) {
|
|
199
|
-
var schema = step.schemas[0];
|
|
200
|
-
var dynamicForm = convertStepSchemaToDynamicForm(schema);
|
|
201
|
-
if (isWideForm()) {
|
|
202
|
-
layout.push(dynamicForm);
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
layout.push(dynamicBox([dynamicForm], 'md'));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return layout;
|
|
209
|
-
}
|
|
210
|
-
function isWideForm() {
|
|
211
|
-
// For the time being we won't support automatically widening forms
|
|
212
|
-
// Unlike it V2, there is no way to easily iterate and identify narrow fields
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
function addMissingTitleAndDescriptionToStep(step, displayStepTitle) {
|
|
216
|
-
return __spreadArray(__spreadArray(__spreadArray([], (displayStepTitle && step.title ? [convertStepTitleToDynamicHeading(step.title)] : []), true), (step.description ? [convertStepDescriptionToDynamicParagraph(step.description)] : []), true), (step.layout || []), true);
|
|
217
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Action, LayoutComponent, Model, Schema } from '../../../dynamic-flow-types';
|
|
2
|
-
export declare function inlineReferences({ layout, schemas, actions, model, }: {
|
|
3
|
-
layout: LayoutComponent[];
|
|
4
|
-
schemas: Schema[];
|
|
5
|
-
actions: Action[];
|
|
6
|
-
model: Model;
|
|
7
|
-
}): LayoutComponent[];
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { convertStepActionToDynamicAction } from './convertStepToLayout';
|
|
13
|
-
export function inlineReferences(_a) {
|
|
14
|
-
var layout = _a.layout, schemas = _a.schemas, actions = _a.actions, model = _a.model;
|
|
15
|
-
if (!layout) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
if (!schemas) {
|
|
19
|
-
return layout;
|
|
20
|
-
}
|
|
21
|
-
return layout.map(function (component) {
|
|
22
|
-
if (component.type === 'form') {
|
|
23
|
-
return inlineFormSchema({ formComponent: component, schemas: schemas });
|
|
24
|
-
}
|
|
25
|
-
if (component.type === 'decision') {
|
|
26
|
-
return inlineDecisionActions({ decisionComponent: component, actions: actions });
|
|
27
|
-
}
|
|
28
|
-
if (component.type === 'button') {
|
|
29
|
-
return inlineAction({ actionComponent: component, actions: actions });
|
|
30
|
-
}
|
|
31
|
-
if (component.type === 'box') {
|
|
32
|
-
return inlineBoxReferences({ boxComponent: component, schemas: schemas, actions: actions, model: model });
|
|
33
|
-
}
|
|
34
|
-
if (component.type === 'columns') {
|
|
35
|
-
return inlineColumnsReferences({ columnsComponent: component, schemas: schemas, actions: actions, model: model });
|
|
36
|
-
}
|
|
37
|
-
return component;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function inlineFormSchema(_a) {
|
|
41
|
-
var formComponent = _a.formComponent, schemas = _a.schemas;
|
|
42
|
-
if (isReference(formComponent.schema) && formComponent.schema.$ref) {
|
|
43
|
-
return __assign(__assign({}, formComponent), { schema: getSchemaById(schemas, formComponent.schema.$ref) });
|
|
44
|
-
}
|
|
45
|
-
return __assign({}, formComponent);
|
|
46
|
-
}
|
|
47
|
-
function inlineDecisionActions(_a) {
|
|
48
|
-
var _b;
|
|
49
|
-
var decisionComponent = _a.decisionComponent, actions = _a.actions;
|
|
50
|
-
var newOptions = (_b = decisionComponent === null || decisionComponent === void 0 ? void 0 : decisionComponent.options) === null || _b === void 0 ? void 0 : _b.map(function (option) {
|
|
51
|
-
return option.action && isReference(option.action)
|
|
52
|
-
? __assign(__assign({}, option), { action: getActionById(actions, option.action.$ref) }) : option;
|
|
53
|
-
});
|
|
54
|
-
return __assign(__assign({}, decisionComponent), { options: newOptions });
|
|
55
|
-
}
|
|
56
|
-
function inlineAction(_a) {
|
|
57
|
-
var _b;
|
|
58
|
-
var actionComponent = _a.actionComponent, actions = _a.actions;
|
|
59
|
-
if (actionComponent.action &&
|
|
60
|
-
isReference(actionComponent.action) &&
|
|
61
|
-
((_b = actionComponent.action) === null || _b === void 0 ? void 0 : _b.$ref)) {
|
|
62
|
-
var newAction = getActionById(actions, actionComponent.action.$ref);
|
|
63
|
-
return convertStepActionToDynamicAction(newAction);
|
|
64
|
-
}
|
|
65
|
-
return actionComponent;
|
|
66
|
-
}
|
|
67
|
-
function inlineBoxReferences(_a) {
|
|
68
|
-
var boxComponent = _a.boxComponent, schemas = _a.schemas, actions = _a.actions, model = _a.model;
|
|
69
|
-
return __assign(__assign({}, boxComponent), { components: inlineReferences({ layout: boxComponent.components, schemas: schemas, actions: actions, model: model }) });
|
|
70
|
-
}
|
|
71
|
-
function inlineColumnsReferences(_a) {
|
|
72
|
-
var columnsComponent = _a.columnsComponent, schemas = _a.schemas, actions = _a.actions, model = _a.model;
|
|
73
|
-
return __assign(__assign({}, columnsComponent), { left: inlineReferences({ layout: columnsComponent.left, schemas: schemas, actions: actions, model: model }), right: inlineReferences({ layout: columnsComponent.right, schemas: schemas, actions: actions, model: model }) });
|
|
74
|
-
}
|
|
75
|
-
function getSchemaById(schemas, id) {
|
|
76
|
-
var schema = schemas.find(function (schema) { return schema.$id === id; });
|
|
77
|
-
if (!schema) {
|
|
78
|
-
throw new Error("Fatal Error. Schema not found. $id ".concat(id));
|
|
79
|
-
}
|
|
80
|
-
return schema;
|
|
81
|
-
}
|
|
82
|
-
function getActionById(actions, id) {
|
|
83
|
-
var action = actions.find(function (action) { return action.$id === id; });
|
|
84
|
-
if (!action) {
|
|
85
|
-
throw new Error("Fatal Error. Action not found. $id ".concat(id));
|
|
86
|
-
}
|
|
87
|
-
return action;
|
|
88
|
-
}
|
|
89
|
-
function isReference(block) {
|
|
90
|
-
return Object.prototype.hasOwnProperty.call(block, '$ref');
|
|
91
|
-
}
|