@wise/dynamic-flow-client 0.1.1 → 0.1.3
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/api/utils.d.ts +4 -0
- package/build/common/api/utils.js +13 -0
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.d.ts +11 -0
- package/build/common/contexts/dynamicFlowContext/dynamicFlowContext.js +36 -0
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.d.ts +4 -0
- package/build/common/contexts/dynamicFlowContext/usePendingPromiseCounter.js +13 -0
- package/build/common/contexts/fetcherContext/fetcherContext.d.ts +18 -0
- package/build/common/contexts/fetcherContext/fetcherContext.js +35 -0
- package/build/common/contexts/fetcherContext/index.d.ts +2 -0
- package/build/common/contexts/fetcherContext/index.js +2 -0
- package/build/common/contexts/fetcherContext/makeFetcher.d.ts +2 -0
- package/build/common/contexts/fetcherContext/makeFetcher.js +33 -0
- package/build/common/general/index.d.ts +2 -0
- package/build/common/general/index.js +22 -0
- package/build/common/hooks/useDebouncedFunction.d.ts +2 -0
- package/build/common/hooks/useDebouncedFunction.js +9 -0
- package/build/common/hooks/useDebouncedFunction.test.d.ts +1 -0
- package/build/common/hooks/useDebouncedFunction.test.js +59 -0
- package/build/common/hooks/usePersistAsync.d.ts +7 -0
- package/build/common/hooks/usePersistAsync.js +170 -0
- package/build/common/hooks/usePolling.d.ts +11 -0
- package/build/common/hooks/usePolling.js +48 -0
- package/build/common/hooks/usePrevious.d.ts +2 -0
- package/build/common/hooks/usePrevious.js +9 -0
- package/build/common/index.d.ts +4 -0
- package/build/common/index.js +4 -0
- package/build/common/logging/index.d.ts +22 -0
- package/build/common/logging/index.js +39 -0
- package/build/common/logging/spec.d.ts +1 -0
- package/build/common/logging/spec.js +45 -0
- package/build/common/messages.d.ts +8 -0
- package/build/common/messages.js +8 -0
- package/build/common/propsValues/dateMode.d.ts +4 -0
- package/build/common/propsValues/dateMode.js +4 -0
- package/build/common/propsValues/formControlType.d.ts +17 -0
- package/build/common/propsValues/formControlType.js +17 -0
- package/build/common/propsValues/monthFormat.d.ts +4 -0
- package/build/common/propsValues/monthFormat.js +4 -0
- package/build/common/propsValues/size.d.ts +7 -0
- package/build/common/propsValues/size.js +7 -0
- package/build/common/requirements.d.ts +10 -0
- package/build/common/requirements.js +50 -0
- package/build/common/schemaTypes/schemaTypes.d.ts +23 -0
- package/build/common/schemaTypes/schemaTypes.js +53 -0
- package/build/common/schemaTypes/shouldDebounceSchema.d.ts +2 -0
- package/build/common/schemaTypes/shouldDebounceSchema.js +6 -0
- package/build/common/stepTypes/stepTypes.d.ts +7 -0
- package/build/common/stepTypes/stepTypes.js +42 -0
- package/build/common/tracking/index.d.ts +15 -0
- package/build/common/tracking/index.js +33 -0
- package/build/common/tracking/spec.d.ts +1 -0
- package/build/common/tracking/spec.js +49 -0
- package/build/common/utils/file-utils.d.ts +4 -0
- package/build/common/utils/file-utils.js +45 -0
- package/build/common/utils/generate-random-id.d.ts +1 -0
- package/build/common/utils/generate-random-id.js +5 -0
- package/build/common/utils/generate-random-id.test.d.ts +1 -0
- package/build/common/utils/generate-random-id.test.js +12 -0
- package/build/common/validation/rule-validators/index.d.ts +10 -0
- package/build/common/validation/rule-validators/index.js +40 -0
- package/build/common/validation/rule-validators/spec.d.ts +1 -0
- package/build/common/validation/rule-validators/spec.js +145 -0
- package/build/common/validation/schema-validators/index.d.ts +9 -0
- package/build/common/validation/schema-validators/index.js +98 -0
- package/build/common/validation/schema-validators/spec.d.ts +1 -0
- package/build/common/validation/schema-validators/spec.js +137 -0
- package/build/common/validation/valid-model/index.d.ts +5 -0
- package/build/common/validation/valid-model/index.js +64 -0
- package/build/common/validation/valid-model/spec.d.ts +1 -0
- package/build/common/validation/valid-model/spec.js +605 -0
- package/build/common/validation/valid-model/utils.d.ts +11 -0
- package/build/common/validation/valid-model/utils.js +118 -0
- package/build/common/validation/validation-failures/index.d.ts +23 -0
- package/build/common/validation/validation-failures/index.js +140 -0
- package/build/common/validation/validation-failures/spec.d.ts +1 -0
- package/build/common/validation/validation-failures/spec.js +185 -0
- package/build/dynamic-flow-types/Action.d.ts +19 -0
- package/build/dynamic-flow-types/Action.js +1 -0
- package/build/dynamic-flow-types/FileUploadSchema.d.ts +23 -0
- package/build/dynamic-flow-types/FileUploadSchema.js +3 -0
- package/build/dynamic-flow-types/LayoutComponent.d.ts +129 -0
- package/build/dynamic-flow-types/LayoutComponent.js +1 -0
- package/build/dynamic-flow-types/Model.d.ts +12 -0
- package/build/dynamic-flow-types/Model.js +28 -0
- package/build/dynamic-flow-types/PersistAsync.d.ts +8 -0
- package/build/dynamic-flow-types/PersistAsync.js +1 -0
- package/build/dynamic-flow-types/Polling.d.ts +12 -0
- package/build/dynamic-flow-types/Polling.js +1 -0
- package/build/dynamic-flow-types/Promotion.d.ts +20 -0
- package/build/dynamic-flow-types/Promotion.js +1 -0
- package/build/dynamic-flow-types/Schema.d.ts +184 -0
- package/build/dynamic-flow-types/Schema.js +49 -0
- package/build/dynamic-flow-types/Step.d.ts +127 -0
- package/build/dynamic-flow-types/Step.js +4 -0
- package/build/dynamic-flow-types/ValidationAsync.d.ts +6 -0
- package/build/dynamic-flow-types/ValidationAsync.js +1 -0
- package/build/dynamic-flow-types/core.d.ts +29 -0
- package/build/dynamic-flow-types/core.js +1 -0
- package/build/dynamic-flow-types/index.d.ts +14 -0
- package/build/dynamic-flow-types/index.js +12 -0
- package/build/field/Field.d.ts +69 -0
- package/build/field/Field.js +311 -0
- package/build/field/index.d.ts +2 -0
- package/build/field/index.js +2 -0
- package/build/flow/DynamicFlow.d.ts +4 -0
- package/build/flow/DynamicFlow.js +368 -0
- package/build/flow/DynamicFlowStep.d.ts +9 -0
- package/build/flow/DynamicFlowStep.js +32 -0
- package/build/flow/errorBoundary/ErrorBoundary.d.ts +20 -0
- package/build/flow/errorBoundary/ErrorBoundary.js +45 -0
- package/build/flow/errorBoundary/ErrorBoundary.messages.d.ts +13 -0
- package/build/flow/errorBoundary/ErrorBoundary.messages.js +13 -0
- package/build/flow/errorBoundary/ErrorBoundaryAlert.d.ts +6 -0
- package/build/flow/errorBoundary/ErrorBoundaryAlert.js +12 -0
- package/build/flow/errorBoundary/index.d.ts +1 -0
- package/build/flow/errorBoundary/index.js +1 -0
- package/build/flow/fixtures/components/alert.d.ts +3 -0
- package/build/flow/fixtures/components/alert.js +31 -0
- package/build/flow/fixtures/components/box.d.ts +3 -0
- package/build/flow/fixtures/components/box.js +20 -0
- package/build/flow/fixtures/components/button.d.ts +3 -0
- package/build/flow/fixtures/components/button.js +65 -0
- package/build/flow/fixtures/components/columns.d.ts +3 -0
- package/build/flow/fixtures/components/columns.js +36 -0
- package/build/flow/fixtures/components/copyable.d.ts +3 -0
- package/build/flow/fixtures/components/copyable.js +22 -0
- package/build/flow/fixtures/components/decision.d.ts +3 -0
- package/build/flow/fixtures/components/decision.js +54 -0
- package/build/flow/fixtures/components/heading.d.ts +3 -0
- package/build/flow/fixtures/components/heading.js +14 -0
- package/build/flow/fixtures/components/image.d.ts +3 -0
- package/build/flow/fixtures/components/image.js +22 -0
- package/build/flow/fixtures/components/info.d.ts +3 -0
- package/build/flow/fixtures/components/info.js +17 -0
- package/build/flow/fixtures/components/list.d.ts +3 -0
- package/build/flow/fixtures/components/list.js +34 -0
- package/build/flow/fixtures/components/loading-indicator.d.ts +3 -0
- package/build/flow/fixtures/components/loading-indicator.js +16 -0
- package/build/flow/fixtures/components/paragraph.d.ts +3 -0
- package/build/flow/fixtures/components/paragraph.js +28 -0
- package/build/flow/fixtures/components/review.d.ts +3 -0
- package/build/flow/fixtures/components/review.js +60 -0
- package/build/flow/fixtures/examples/camera-capture.d.ts +3 -0
- package/build/flow/fixtures/examples/camera-capture.js +121 -0
- package/build/flow/fixtures/examples/recipient-update.d.ts +3 -0
- package/build/flow/fixtures/examples/recipient-update.js +250 -0
- package/build/flow/fixtures/examples/recipient.d.ts +3 -0
- package/build/flow/fixtures/examples/recipient.js +313 -0
- package/build/flow/fixtures/examples/single-file-upload.d.ts +3 -0
- package/build/flow/fixtures/examples/single-file-upload.js +96 -0
- package/build/flow/fixtures/examples/step-validation-errors.d.ts +3 -0
- package/build/flow/fixtures/examples/step-validation-errors.js +75 -0
- package/build/flow/fixtures/features/action-response.d.ts +3 -0
- package/build/flow/fixtures/features/action-response.js +29 -0
- package/build/flow/fixtures/features/external.d.ts +3 -0
- package/build/flow/fixtures/features/external.js +31 -0
- package/build/flow/fixtures/features/persist-async.d.ts +3 -0
- package/build/flow/fixtures/features/persist-async.js +44 -0
- package/build/flow/fixtures/features/polling.d.ts +3 -0
- package/build/flow/fixtures/features/polling.js +33 -0
- package/build/flow/fixtures/index.d.ts +42 -0
- package/build/flow/fixtures/index.js +66 -0
- package/build/flow/fixtures/responses/action-response-final.d.ts +3 -0
- package/build/flow/fixtures/responses/action-response-final.js +24 -0
- package/build/flow/fixtures/responses/action.d.ts +5 -0
- package/build/flow/fixtures/responses/action.js +2 -0
- package/build/flow/fixtures/responses/exit.d.ts +6 -0
- package/build/flow/fixtures/responses/exit.js +2 -0
- package/build/flow/fixtures/responses/recipient-update-final.d.ts +3 -0
- package/build/flow/fixtures/responses/recipient-update-final.js +24 -0
- package/build/flow/fixtures/schemas/basic-form.d.ts +3 -0
- package/build/flow/fixtures/schemas/basic-form.js +39 -0
- package/build/flow/fixtures/schemas/number-and-integer.d.ts +3 -0
- package/build/flow/fixtures/schemas/number-and-integer.js +41 -0
- package/build/flow/fixtures/schemas/one-of.d.ts +3 -0
- package/build/flow/fixtures/schemas/one-of.js +223 -0
- package/build/flow/fixtures/schemas/string-formats.d.ts +3 -0
- package/build/flow/fixtures/schemas/string-formats.js +58 -0
- package/build/flow/index.d.ts +1 -0
- package/build/flow/index.js +1 -0
- package/build/flow/response-parsers/index.d.ts +17 -0
- package/build/flow/response-parsers/index.js +112 -0
- package/build/flow/response-parsers/spec.d.ts +1 -0
- package/build/flow/response-parsers/spec.js +263 -0
- package/build/flow/stories/EditableDynamicFlow.d.ts +5 -0
- package/build/flow/stories/EditableDynamicFlow.js +61 -0
- package/build/flow/types.d.ts +77 -0
- package/build/flow/types.js +3 -0
- package/build/flow/useDebouncedRefresh/index.d.ts +1 -0
- package/build/flow/useDebouncedRefresh/index.js +1 -0
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.d.ts +5 -0
- package/build/flow/useDebouncedRefresh/useDebouncedRefresh.js +24 -0
- package/build/flow/useDynamicFlowState.d.ts +18 -0
- package/build/flow/useDynamicFlowState.js +111 -0
- package/build/flow/useLoader.d.ts +9 -0
- package/build/flow/useLoader.js +22 -0
- package/build/formControl/FormControl.d.ts +86 -0
- package/build/formControl/FormControl.js +241 -0
- package/build/formControl/index.d.ts +1 -0
- package/build/formControl/index.js +1 -0
- package/build/formControl/types.d.ts +57 -0
- package/build/formControl/types.js +1 -0
- package/build/formControl/value-utils.d.ts +9 -0
- package/build/formControl/value-utils.js +108 -0
- package/build/i18n/cs.json +8 -0
- package/build/i18n/de.json +34 -0
- package/build/i18n/en.json +38 -0
- package/build/i18n/es.json +34 -0
- package/build/i18n/fr.json +34 -0
- package/build/i18n/hu.json +34 -0
- package/build/i18n/id.json +34 -0
- package/build/i18n/index.d.ts +2 -0
- package/build/i18n/index.js +31 -0
- package/build/i18n/it.json +34 -0
- package/build/i18n/ja.json +34 -0
- package/build/i18n/pl.json +11 -0
- package/build/i18n/pt.json +34 -0
- package/build/i18n/ro.json +34 -0
- package/build/i18n/ru.json +34 -0
- package/build/i18n/th.json +34 -0
- package/build/i18n/tr.json +11 -0
- package/build/i18n/uk.json +8 -0
- package/build/i18n/zh-CN.json +34 -0
- package/build/i18n/zh.json +34 -0
- package/build/index.d.ts +12 -0
- package/build/index.js +11 -0
- package/build/jsonSchemaForm/JsonSchemaForm.d.ts +66 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +31 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +14 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +54 -0
- package/build/jsonSchemaForm/allOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +15 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +25 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +16 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +26 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +141 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.d.ts +24 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +18 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.d.ts +9 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/useFormattedDefaultErrorMessages.js +14 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.d.ts +6 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils.js +85 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +22 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +105 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +31 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +79 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.d.ts +53 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +53 -0
- package/build/jsonSchemaForm/controlFeedback/index.d.ts +1 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +1 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.d.ts +19 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +122 -0
- package/build/jsonSchemaForm/genericSchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/genericSchema/index.js +1 -0
- package/build/jsonSchemaForm/help/Help.d.ts +8 -0
- package/build/jsonSchemaForm/help/Help.js +9 -0
- package/build/jsonSchemaForm/help/Help.messages.d.ts +8 -0
- package/build/jsonSchemaForm/help/Help.messages.js +8 -0
- package/build/jsonSchemaForm/help/index.d.ts +1 -0
- package/build/jsonSchemaForm/help/index.js +1 -0
- package/build/jsonSchemaForm/index.d.ts +1 -0
- package/build/jsonSchemaForm/index.js +1 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +16 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +78 -0
- package/build/jsonSchemaForm/objectSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/objectSchema/index.js +1 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +15 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +153 -0
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.d.ts +3 -0
- package/build/jsonSchemaForm/oneOfSchema/getActiveSchemaIndex.js +40 -0
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/getBestMatchingSchemaIndexForValue.js +27 -0
- package/build/jsonSchemaForm/oneOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.d.ts +3 -0
- package/build/jsonSchemaForm/oneOfSchema/isConstSchema.js +7 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +16 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +26 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.d.ts +8 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +8 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.d.ts +21 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/PersistAsyncBasicSchema.js +168 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.d.ts +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/basic/index.js +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.d.ts +20 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/PersistAsyncBlobSchema.js +127 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.d.ts +17 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/UploadInputAdapter.js +32 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.d.ts +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/blob/index.js +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +9 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +72 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.d.ts +2 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchemaModelMatcher.js +8 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.d.ts +7 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfCheckboxControl.js +27 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.d.ts +23 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfControl.js +31 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.d.ts +9 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/control/PromotedOneOfRadioControl.js +32 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +8 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +55 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.d.ts +16 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +13 -0
- package/build/jsonSchemaForm/readOnlySchema/index.d.ts +1 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +25 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +106 -0
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.d.ts +3 -0
- package/build/jsonSchemaForm/schemaFormControl/availableCurrencyFlags.js +73 -0
- package/build/jsonSchemaForm/schemaFormControl/index.d.ts +1 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +1 -0
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.d.ts +40 -0
- package/build/jsonSchemaForm/schemaFormControl/optionMapper.js +89 -0
- package/build/jsonSchemaForm/schemas/allOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/allOf.json.js +119 -0
- package/build/jsonSchemaForm/schemas/audRecipient.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/audRecipient.json.js +1104 -0
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/base64Url_MultipleFileUpload.json.js +37 -0
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/blob_MultipleFileUpload.json.js +36 -0
- package/build/jsonSchemaForm/schemas/currency.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/currency.json.js +48 -0
- package/build/jsonSchemaForm/schemas/oneOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/oneOf.json.js +119 -0
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/oneOfTabs.json.js +53 -0
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/promotedOneOf.json.js +56 -0
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/promotedOneOfCheckbox.json.js +102 -0
- package/build/jsonSchemaForm/schemas/simple.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/simple.json.js +48 -0
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/uploadPersistAsync.json.js +71 -0
- package/build/jsonSchemaForm/schemas/validationAsync.json.d.ts +3 -0
- package/build/jsonSchemaForm/schemas/validationAsync.json.js +23 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +17 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +149 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.d.ts +2 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +1 -0
- package/build/layout/DynamicLayout.d.ts +17 -0
- package/build/layout/DynamicLayout.js +75 -0
- package/build/layout/alert/index.d.ts +6 -0
- package/build/layout/alert/index.js +29 -0
- package/build/layout/box/index.d.ts +8 -0
- package/build/layout/box/index.js +41 -0
- package/build/layout/button/index.d.ts +8 -0
- package/build/layout/button/index.js +58 -0
- package/build/layout/columns/index.d.ts +8 -0
- package/build/layout/columns/index.js +38 -0
- package/build/layout/decision/index.d.ts +9 -0
- package/build/layout/decision/index.js +38 -0
- package/build/layout/divider/index.d.ts +7 -0
- package/build/layout/divider/index.js +9 -0
- package/build/layout/external/DynamicExternal.d.ts +8 -0
- package/build/layout/external/DynamicExternal.js +30 -0
- package/build/layout/external/DynamicExternal.messages.d.ts +8 -0
- package/build/layout/external/DynamicExternal.messages.js +8 -0
- package/build/layout/external/index.d.ts +1 -0
- package/build/layout/external/index.js +1 -0
- package/build/layout/external/useExternalStepPolling.d.ts +11 -0
- package/build/layout/external/useExternalStepPolling.js +68 -0
- package/build/layout/form/index.d.ts +8 -0
- package/build/layout/form/index.js +22 -0
- package/build/layout/heading/index.d.ts +6 -0
- package/build/layout/heading/index.js +31 -0
- package/build/layout/icon/index.d.ts +7 -0
- package/build/layout/icon/index.js +22 -0
- package/build/layout/image/index.d.ts +6 -0
- package/build/layout/image/index.js +126 -0
- package/build/layout/index.d.ts +1 -0
- package/build/layout/index.js +1 -0
- package/build/layout/info/index.d.ts +7 -0
- package/build/layout/info/index.js +19 -0
- package/build/layout/layouts/all.json.d.ts +3 -0
- package/build/layout/layouts/all.json.js +176 -0
- package/build/layout/layouts/final-step-layout.json.d.ts +3 -0
- package/build/layout/layouts/final-step-layout.json.js +39 -0
- package/build/layout/layouts/finalStep.json.d.ts +3 -0
- package/build/layout/layouts/finalStep.json.js +24 -0
- package/build/layout/layouts/list.json.d.ts +3 -0
- package/build/layout/layouts/list.json.js +33 -0
- package/build/layout/layouts/pay-in.json.d.ts +3 -0
- package/build/layout/layouts/pay-in.json.js +97 -0
- package/build/layout/layouts/review.json.d.ts +3 -0
- package/build/layout/layouts/review.json.js +160 -0
- package/build/layout/layouts/success.json.d.ts +3 -0
- package/build/layout/layouts/success.json.js +66 -0
- package/build/layout/list/index.d.ts +8 -0
- package/build/layout/list/index.js +30 -0
- package/build/layout/loading-indicator/index.d.ts +7 -0
- package/build/layout/loading-indicator/index.js +10 -0
- package/build/layout/loading-indicator/spec.d.ts +1 -0
- package/build/layout/loading-indicator/spec.js +11 -0
- package/build/layout/paragraph/DynamicParagraph.d.ts +7 -0
- package/build/layout/paragraph/DynamicParagraph.js +42 -0
- package/build/layout/paragraph/DynamicParagraph.messages.d.ts +13 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +13 -0
- package/build/layout/paragraph/index.d.ts +1 -0
- package/build/layout/paragraph/index.js +1 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.d.ts +10 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +9 -0
- package/build/layout/review/index.d.ts +9 -0
- package/build/layout/review/index.js +33 -0
- package/build/layout/utils.d.ts +7 -0
- package/build/layout/utils.js +31 -0
- package/build/main.css +143 -0
- package/build/schema.d.ts +1 -0
- package/build/schema.js +1 -0
- package/build/step/cameraStep/CameraStep.d.ts +8 -0
- package/build/step/cameraStep/CameraStep.js +125 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.d.ts +16 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +122 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.d.ts +18 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +18 -0
- package/build/step/cameraStep/cameraCapture/components/index.d.ts +8 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +28 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.d.ts +4 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +80 -0
- package/build/step/cameraStep/cameraCapture/index.d.ts +1 -0
- package/build/step/cameraStep/cameraCapture/index.js +1 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.d.ts +11 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +78 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.d.ts +3 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +19 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.d.ts +13 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +13 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.d.ts +6 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +21 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.d.ts +18 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +18 -0
- package/build/step/cameraStep/cameraCapture/screens/index.d.ts +2 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +2 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.d.ts +7 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +101 -0
- package/build/step/cameraStep/cameraCapture/utils/index.d.ts +8 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +103 -0
- package/build/step/cameraStep/index.d.ts +1 -0
- package/build/step/cameraStep/index.js +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.d.ts +7 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +64 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.d.ts +23 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +23 -0
- package/build/step/externalConfirmationStep/index.d.ts +1 -0
- package/build/step/externalConfirmationStep/index.js +1 -0
- package/build/step/features/external/useExternal.d.ts +4 -0
- package/build/step/features/external/useExternal.js +15 -0
- package/build/step/features/index.d.ts +2 -0
- package/build/step/features/index.js +2 -0
- package/build/step/features/polling/useStepPolling.d.ts +2 -0
- package/build/step/features/polling/useStepPolling.js +44 -0
- package/build/step/index.d.ts +3 -0
- package/build/step/index.js +3 -0
- package/build/step/layoutStep/LayoutStep.d.ts +11 -0
- package/build/step/layoutStep/LayoutStep.js +34 -0
- package/build/step/layoutStep/index.d.ts +1 -0
- package/build/step/layoutStep/index.js +1 -0
- package/build/step/layoutStep/layoutService/convertStepToLayout.d.ts +8 -0
- package/build/step/layoutStep/layoutService/convertStepToLayout.js +217 -0
- package/build/step/layoutStep/layoutService/index.d.ts +2 -0
- package/build/step/layoutStep/layoutService/index.js +2 -0
- package/build/step/layoutStep/layoutService/inlineReferences.d.ts +7 -0
- package/build/step/layoutStep/layoutService/inlineReferences.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
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 { useCallback, useMemo } from 'react';
|
|
13
|
+
import { useFetcher } from '../../common/contexts/fetcherContext';
|
|
14
|
+
import { usePolling } from '../../common/hooks/usePolling';
|
|
15
|
+
export function useStepPolling(polling, onAction) {
|
|
16
|
+
var fetcher = useFetcher();
|
|
17
|
+
var asyncFn = useMemo(function () {
|
|
18
|
+
if (polling) {
|
|
19
|
+
return function () {
|
|
20
|
+
return fetcher(polling.url).then(function (response) {
|
|
21
|
+
if (response.ok) {
|
|
22
|
+
try {
|
|
23
|
+
return response.json();
|
|
24
|
+
}
|
|
25
|
+
catch (_a) {
|
|
26
|
+
throw new Error('failed');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
throw new Error('failed');
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}, [polling, fetcher]);
|
|
39
|
+
var onPollingResponse = useCallback(function (pollingResponse) {
|
|
40
|
+
var responseHandlers = (polling === null || polling === void 0 ? void 0 : polling.responseHandlers) || [];
|
|
41
|
+
var responseHandler = responseHandlers.find(function (handler) { return handler.result === pollingResponse.result; });
|
|
42
|
+
if (responseHandler === null || responseHandler === void 0 ? void 0 : responseHandler.action) {
|
|
43
|
+
var action = responseHandler.action;
|
|
44
|
+
if (action.exit) {
|
|
45
|
+
var mergedResult = __assign(__assign({}, (action.result || {})), (pollingResponse.data || {}));
|
|
46
|
+
onAction(__assign(__assign({}, action), { result: mergedResult }));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
var mergedData = __assign(__assign({}, (action.data || {})), (pollingResponse.data || {}));
|
|
50
|
+
onAction(__assign(__assign({}, action), { data: mergedData }));
|
|
51
|
+
}
|
|
52
|
+
return false; // stop polling
|
|
53
|
+
}
|
|
54
|
+
return true; // continue polling
|
|
55
|
+
}, [polling === null || polling === void 0 ? void 0 : polling.responseHandlers, onAction]);
|
|
56
|
+
usePolling({
|
|
57
|
+
asyncFn: asyncFn,
|
|
58
|
+
interval: (polling === null || polling === void 0 ? void 0 : polling.interval) || 0,
|
|
59
|
+
maxAttempts: (polling === null || polling === void 0 ? void 0 : polling.maxAttempts) || 0,
|
|
60
|
+
maxConsecutiveFails: (polling === null || polling === void 0 ? void 0 : polling.maxConsecutiveFails) || 0,
|
|
61
|
+
onPollingResponse: onPollingResponse,
|
|
62
|
+
onFailure: useCallback(function () {
|
|
63
|
+
if (polling) {
|
|
64
|
+
onAction(polling.onError.action);
|
|
65
|
+
}
|
|
66
|
+
}, [onAction, polling])
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormLayout } from '../../dynamic-flow-types';
|
|
3
|
+
import { CommonLayoutProps } from '../DynamicLayout';
|
|
4
|
+
type Props = Omit<CommonLayoutProps, 'onAction'> & {
|
|
5
|
+
component: FormLayout;
|
|
6
|
+
};
|
|
7
|
+
declare const DynamicForm: (props: Props) => JSX.Element;
|
|
8
|
+
export default DynamicForm;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import JsonSchemaForm from '../../jsonSchemaForm';
|
|
14
|
+
import { getMarginBottom } from '../utils';
|
|
15
|
+
var DynamicForm = function (props) {
|
|
16
|
+
var form = props.component;
|
|
17
|
+
var formSchema = form.schema; // There should be no $ref at this point
|
|
18
|
+
return (_jsx("div", __assign({ className: getMarginBottom(form.margin || 'md') }, { children: _jsx(JsonSchemaForm, { schema: formSchema, model: props.model, submitted: props.submitted, errors: props.errors, onChange: function (parameters) {
|
|
19
|
+
props.onModelChange(__assign({ formSchema: formSchema }, parameters));
|
|
20
|
+
}, onPersistAsync: props.onPersistAsync }) })));
|
|
21
|
+
};
|
|
22
|
+
export default DynamicForm;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { getTextAlignmentAndMargin } from '../utils';
|
|
14
|
+
var DynamicHeading = function (props) {
|
|
15
|
+
var _a = props.component, text = _a.text, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.align, align = _c === void 0 ? 'left' : _c, _d = _a.margin, margin = _d === void 0 ? 'md' : _d;
|
|
16
|
+
var classes = getTextAlignmentAndMargin({ align: align, margin: margin });
|
|
17
|
+
switch (size) {
|
|
18
|
+
case 'xs':
|
|
19
|
+
return _jsx("h5", __assign({ className: classes }, { children: text }));
|
|
20
|
+
case 'sm':
|
|
21
|
+
return _jsx("h4", __assign({ className: classes }, { children: text }));
|
|
22
|
+
case 'lg':
|
|
23
|
+
return _jsx("h2", __assign({ className: classes }, { children: text }));
|
|
24
|
+
case 'xl':
|
|
25
|
+
return _jsx("h1", __assign({ className: classes }, { children: text }));
|
|
26
|
+
case 'md':
|
|
27
|
+
default:
|
|
28
|
+
return _jsx("h3", __assign({ className: classes }, { children: text }));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export default DynamicHeading;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as icons from '@transferwise/icons';
|
|
3
|
+
var DynamicIcon = function (props) {
|
|
4
|
+
var iconName = toCapitalisedCamelCase(props.type);
|
|
5
|
+
if (!Object.keys(icons).includes(iconName)) {
|
|
6
|
+
return _jsx(_Fragment, {});
|
|
7
|
+
}
|
|
8
|
+
var Icon = icons[iconName];
|
|
9
|
+
return _jsx(Icon, { size: 24 });
|
|
10
|
+
};
|
|
11
|
+
function toCapitalisedCamelCase(value) {
|
|
12
|
+
return value.split('-').map(capitaliseFirstChar).join('');
|
|
13
|
+
}
|
|
14
|
+
function capitaliseFirstChar(value) {
|
|
15
|
+
var _a;
|
|
16
|
+
return "".concat((_a = value[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()).concat(value.slice(1));
|
|
17
|
+
}
|
|
18
|
+
export function isValidIconName(name) {
|
|
19
|
+
var iconName = toCapitalisedCamelCase(name);
|
|
20
|
+
return Object.keys(icons).includes(iconName);
|
|
21
|
+
}
|
|
22
|
+
export default DynamicIcon;
|
|
@@ -0,0 +1,126 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
+
import { Image } from '@transferwise/components';
|
|
50
|
+
import { useEffect, useState } from 'react';
|
|
51
|
+
import { isRelativePath } from '../../common/api/utils';
|
|
52
|
+
import { useFetcher } from '../../common/contexts/fetcherContext';
|
|
53
|
+
import { getMarginBottom } from '../utils';
|
|
54
|
+
var getWrapperClasses = function (component) {
|
|
55
|
+
switch (component.size) {
|
|
56
|
+
case 'xs':
|
|
57
|
+
return 'col-xs-2 col-xs-offset-5';
|
|
58
|
+
case 'sm':
|
|
59
|
+
return 'col-xs-4 col-xs-offset-4';
|
|
60
|
+
case 'md':
|
|
61
|
+
return 'col-xs-6 col-xs-offset-3';
|
|
62
|
+
case 'lg':
|
|
63
|
+
return 'col-xs-8 col-xs-offset-2';
|
|
64
|
+
case 'xl':
|
|
65
|
+
default:
|
|
66
|
+
return 'col-xs-12';
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var getImageClasses = function (image) {
|
|
70
|
+
var margin = getMarginBottom(image.margin || 'lg');
|
|
71
|
+
return "img-responsive ".concat(margin);
|
|
72
|
+
};
|
|
73
|
+
var readImageBlobAsDataURL = function (imageBlob) {
|
|
74
|
+
// we can safely assume the type of reader.result is string
|
|
75
|
+
// because we're calling reader.readAsDataURL
|
|
76
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileReader/result
|
|
77
|
+
return new Promise(function (resolve, reject) {
|
|
78
|
+
var reader = new FileReader();
|
|
79
|
+
reader.addEventListener('loadend', function () { return resolve(reader.result); });
|
|
80
|
+
reader.addEventListener('error', function (error) { return reject(error); });
|
|
81
|
+
reader.readAsDataURL(imageBlob);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
var getImageSource = function (fetcher, imageUrl) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var _a;
|
|
86
|
+
return __generator(this, function (_b) {
|
|
87
|
+
try {
|
|
88
|
+
if (isRelativePath(imageUrl) || (imageUrl === null || imageUrl === void 0 ? void 0 : imageUrl.indexOf("".concat((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin, "/"))) === 0) {
|
|
89
|
+
return [2 /*return*/, fetcher(imageUrl, {
|
|
90
|
+
method: 'GET',
|
|
91
|
+
headers: { 'Content-Type': 'image/image' },
|
|
92
|
+
credentials: 'same-origin'
|
|
93
|
+
})
|
|
94
|
+
.then(function (response) { return response.blob(); })
|
|
95
|
+
.then(readImageBlobAsDataURL)];
|
|
96
|
+
}
|
|
97
|
+
return [2 /*return*/, imageUrl];
|
|
98
|
+
}
|
|
99
|
+
catch (_c) {
|
|
100
|
+
return [2 /*return*/, imageUrl];
|
|
101
|
+
}
|
|
102
|
+
return [2 /*return*/];
|
|
103
|
+
});
|
|
104
|
+
}); };
|
|
105
|
+
var DynamicImage = function (props) {
|
|
106
|
+
var image = props.component;
|
|
107
|
+
var fetcher = useFetcher();
|
|
108
|
+
var _a = useState(''), imageSource = _a[0], setImageSource = _a[1];
|
|
109
|
+
useEffect(function () {
|
|
110
|
+
void getImageSource(fetcher, image.url).then(setImageSource);
|
|
111
|
+
}, [image.url, fetcher]);
|
|
112
|
+
var imageProps = {
|
|
113
|
+
alt: image.text || '',
|
|
114
|
+
src: imageSource,
|
|
115
|
+
stretch: true,
|
|
116
|
+
shrink: true
|
|
117
|
+
};
|
|
118
|
+
var getImage = function () {
|
|
119
|
+
return imageSource ? _jsx(Image, __assign({ className: getImageClasses(image) }, imageProps)) : null;
|
|
120
|
+
};
|
|
121
|
+
if (!image.size || image.size === 'xl') {
|
|
122
|
+
return getImage();
|
|
123
|
+
}
|
|
124
|
+
return (_jsx("div", __assign({ className: "row m-b-0" }, { children: _jsx("div", __assign({ className: getWrapperClasses(image) }, { children: getImage() })) })));
|
|
125
|
+
};
|
|
126
|
+
export default DynamicImage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DynamicLayout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DynamicLayout';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Markdown } from '@transferwise/components';
|
|
14
|
+
import { getTextAlignmentAndMargin } from '../utils';
|
|
15
|
+
var DynamicInfo = function (_a) {
|
|
16
|
+
var component = _a.component;
|
|
17
|
+
return (_jsx("div", __assign({ className: getTextAlignmentAndMargin(component) }, { children: _jsx(Markdown, __assign({ config: { link: { target: '_blank' } } }, { children: component.markdown })) })));
|
|
18
|
+
};
|
|
19
|
+
export default DynamicInfo;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
var layout = [
|
|
2
|
+
{
|
|
3
|
+
type: 'box',
|
|
4
|
+
width: 'md',
|
|
5
|
+
components: [
|
|
6
|
+
{
|
|
7
|
+
type: 'heading',
|
|
8
|
+
text: 'This is a large heading',
|
|
9
|
+
size: 'lg',
|
|
10
|
+
align: 'center',
|
|
11
|
+
margin: 'md'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
type: 'paragraph',
|
|
15
|
+
text: 'This is a paragraph of text. This is a paragraph of text. This is a paragraph of text.',
|
|
16
|
+
align: 'center',
|
|
17
|
+
margin: 'xl'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'loading-indicator',
|
|
21
|
+
size: 'lg',
|
|
22
|
+
margin: 'md'
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: 'columns',
|
|
28
|
+
bias: 'left',
|
|
29
|
+
left: [
|
|
30
|
+
{
|
|
31
|
+
type: 'box',
|
|
32
|
+
border: true,
|
|
33
|
+
components: [
|
|
34
|
+
{
|
|
35
|
+
type: 'heading',
|
|
36
|
+
text: 'Small heading',
|
|
37
|
+
size: 'sm',
|
|
38
|
+
margin: 'md'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: 'divider',
|
|
42
|
+
margin: 'xl'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'review',
|
|
46
|
+
title: 'Review title',
|
|
47
|
+
margin: 'lg',
|
|
48
|
+
orientation: 'horizontal',
|
|
49
|
+
action: {
|
|
50
|
+
$id: 'edit-profile',
|
|
51
|
+
title: 'Edit',
|
|
52
|
+
url: '/edit',
|
|
53
|
+
method: 'GET'
|
|
54
|
+
},
|
|
55
|
+
fields: [
|
|
56
|
+
{
|
|
57
|
+
label: 'First name',
|
|
58
|
+
value: 'John'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Last name',
|
|
62
|
+
value: 'Smith'
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'image',
|
|
68
|
+
text: 'An image of cascading stylesheet computer code',
|
|
69
|
+
url: 'https://bootstrap.transferwise.com/assets/img/css2-bg.jpg',
|
|
70
|
+
margin: 'xs'
|
|
71
|
+
},
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
right: [
|
|
76
|
+
{
|
|
77
|
+
type: 'form',
|
|
78
|
+
schema: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
title: 'Personal details',
|
|
81
|
+
// info: {
|
|
82
|
+
// markdown:
|
|
83
|
+
// 'We need to gather this data to make sure you are who you say you here [click here for more information](/somewhere)',
|
|
84
|
+
// },
|
|
85
|
+
alert: {
|
|
86
|
+
markdown: 'Make sure you get this correct, or your transfer could be held up!',
|
|
87
|
+
context: 'neutral'
|
|
88
|
+
},
|
|
89
|
+
displayOrder: ['firstname', 'lastname'],
|
|
90
|
+
properties: {
|
|
91
|
+
firstname: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
title: 'First name',
|
|
94
|
+
alert: {
|
|
95
|
+
markdown: 'Please use **only** latin characters.',
|
|
96
|
+
context: 'warning'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
lastname: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
title: 'Last name',
|
|
102
|
+
minLength: 3,
|
|
103
|
+
help: {
|
|
104
|
+
markdown: 'help!'
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: 'alert',
|
|
112
|
+
markdown: 'This is an alert - we can use **bold** to provide emphasis.',
|
|
113
|
+
context: 'warning'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'info',
|
|
117
|
+
markdown: '### This heading comes from markdown \n\r We can use markdown to add [links](https://transferwise.com) and _other_ **formatting** \n\r. It will also let us add simple lists: \n - one\n - two\n - #### three'
|
|
118
|
+
},
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'box',
|
|
123
|
+
width: 'sm',
|
|
124
|
+
components: [
|
|
125
|
+
{
|
|
126
|
+
type: 'button',
|
|
127
|
+
action: {
|
|
128
|
+
title: 'Submit',
|
|
129
|
+
url: '',
|
|
130
|
+
method: 'GET',
|
|
131
|
+
data: {},
|
|
132
|
+
type: 'primary'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'button',
|
|
137
|
+
action: {
|
|
138
|
+
title: 'Cancel',
|
|
139
|
+
url: '',
|
|
140
|
+
method: 'GET',
|
|
141
|
+
data: {},
|
|
142
|
+
disabled: true
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'decision',
|
|
149
|
+
options: [
|
|
150
|
+
{
|
|
151
|
+
title: 'More information about this option',
|
|
152
|
+
icon: { name: 'profile' },
|
|
153
|
+
action: {
|
|
154
|
+
title: 'Option 1',
|
|
155
|
+
url: '/option1',
|
|
156
|
+
method: 'POST',
|
|
157
|
+
data: {
|
|
158
|
+
a: 1
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: 'More information about this option',
|
|
164
|
+
icon: { name: 'bank' },
|
|
165
|
+
action: {
|
|
166
|
+
title: 'Option 2',
|
|
167
|
+
url: '/option2',
|
|
168
|
+
method: 'GET',
|
|
169
|
+
data: {},
|
|
170
|
+
disabled: true
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
];
|
|
176
|
+
export default layout;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var layout = [
|
|
2
|
+
{
|
|
3
|
+
type: 'image',
|
|
4
|
+
url: 'https://via.placeholder.com/1024',
|
|
5
|
+
text: 'Image alt text',
|
|
6
|
+
margin: 'lg',
|
|
7
|
+
size: 'sm'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: 'heading',
|
|
11
|
+
text: 'Image size sm',
|
|
12
|
+
size: 'lg',
|
|
13
|
+
margin: 'lg',
|
|
14
|
+
align: 'center'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: 'paragraph',
|
|
18
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vel ante felis. Nullam auctor posuere justo ac posuere. Nullam efficitur enim ut turpis venenatis vestibulum.',
|
|
19
|
+
align: 'center'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: 'box',
|
|
23
|
+
width: 'md',
|
|
24
|
+
components: [
|
|
25
|
+
{
|
|
26
|
+
type: 'button',
|
|
27
|
+
action: {
|
|
28
|
+
title: 'Button',
|
|
29
|
+
type: 'primary',
|
|
30
|
+
exit: true,
|
|
31
|
+
data: { someKey: 'some value' },
|
|
32
|
+
url: '/success',
|
|
33
|
+
method: 'GET'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
export default layout;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var step = {
|
|
2
|
+
key: 'account',
|
|
3
|
+
type: 'final',
|
|
4
|
+
success: true,
|
|
5
|
+
details: {
|
|
6
|
+
image: {
|
|
7
|
+
url: 'https://via.placeholder.com/1024',
|
|
8
|
+
text: 'Image size: sm'
|
|
9
|
+
},
|
|
10
|
+
title: 'Image size: undefined',
|
|
11
|
+
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vel ante felis. Nullam auctor posuere justo ac posuere. Nullam efficitur enim ut turpis venenatis vestibulum.'
|
|
12
|
+
},
|
|
13
|
+
actions: [
|
|
14
|
+
{
|
|
15
|
+
title: 'Continue',
|
|
16
|
+
type: 'primary',
|
|
17
|
+
exit: true,
|
|
18
|
+
data: { someKey: 'some value' },
|
|
19
|
+
url: '/success',
|
|
20
|
+
method: 'GET'
|
|
21
|
+
},
|
|
22
|
+
]
|
|
23
|
+
};
|
|
24
|
+
export default step;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var layout = [
|
|
2
|
+
{
|
|
3
|
+
type: 'list',
|
|
4
|
+
title: 'This is a List',
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
title: 'Item 1',
|
|
8
|
+
description: 'The first item is positive',
|
|
9
|
+
icon: {
|
|
10
|
+
name: 'bank'
|
|
11
|
+
},
|
|
12
|
+
status: 'positive'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
title: 'Item 2',
|
|
16
|
+
description: 'The second item is neutral',
|
|
17
|
+
icon: {
|
|
18
|
+
name: 'emoji'
|
|
19
|
+
},
|
|
20
|
+
status: 'neutral'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'Item 3',
|
|
24
|
+
description: 'The third item is warning',
|
|
25
|
+
icon: {
|
|
26
|
+
name: 'gift-box'
|
|
27
|
+
},
|
|
28
|
+
status: 'warning'
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
export default layout;
|