@wise/dynamic-flow-client 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/constants/DateMode.js +3 -2
- package/build/common/constants/DateMode.js.map +1 -0
- package/build/common/constants/FormControlType.js +3 -2
- package/build/common/constants/FormControlType.js.map +1 -0
- package/build/common/constants/MonthFormat.js +3 -2
- package/build/common/constants/MonthFormat.js.map +1 -0
- package/build/common/constants/SchemaType.js +3 -2
- package/build/common/constants/SchemaType.js.map +1 -0
- package/build/common/constants/Size.js +3 -2
- package/build/common/constants/Size.js.map +1 -0
- package/build/common/constants/index.js +2 -1
- package/build/common/constants/index.js.map +1 -0
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +16 -27
- package/build/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js.map +1 -0
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +12 -9
- package/build/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js.map +1 -0
- package/build/common/contexts/eventsContext/EventsContext.js +12 -28
- package/build/common/contexts/eventsContext/EventsContext.js.map +1 -0
- package/build/common/contexts/fetcherContexts/FetcherContexts.js +15 -27
- package/build/common/contexts/fetcherContexts/FetcherContexts.js.map +1 -0
- package/build/common/contexts/index.js +2 -1
- package/build/common/contexts/index.js.map +1 -0
- package/build/common/contexts/logContext/LogContext.js +13 -30
- package/build/common/contexts/logContext/LogContext.js.map +1 -0
- package/build/common/hooks/index.js +2 -1
- package/build/common/hooks/index.js.map +1 -0
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js +4 -3
- package/build/common/hooks/useDebouncedFunction/useDebouncedFunction.js.map +1 -0
- package/build/common/hooks/useExternal/useExternal.js +9 -8
- package/build/common/hooks/useExternal/useExternal.js.map +1 -0
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js +21 -31
- package/build/common/hooks/useExternalStepPolling/useExternalStepPolling.js.map +1 -0
- package/build/common/hooks/usePersistAsync/usePersistAsync.js +61 -139
- package/build/common/hooks/usePersistAsync/usePersistAsync.js.map +1 -0
- package/build/common/hooks/usePolling/usePolling.js +21 -21
- package/build/common/hooks/usePolling/usePolling.js.map +1 -0
- package/build/common/hooks/usePrevious/usePrevious.js +6 -5
- package/build/common/hooks/usePrevious/usePrevious.js.map +1 -0
- package/build/common/hooks/useStepPolling/useStepPolling.js +16 -14
- package/build/common/hooks/useStepPolling/useStepPolling.js.map +1 -0
- package/build/common/makeFetcher/index.js +2 -1
- package/build/common/makeFetcher/index.js.map +1 -0
- package/build/common/makeFetcher/makeFetcher.js +11 -24
- package/build/common/makeFetcher/makeFetcher.js.map +1 -0
- package/build/common/messages.js +6 -5
- package/build/common/messages.js.map +1 -0
- package/build/common/utils/api-utils.js +4 -4
- package/build/common/utils/api-utils.js.map +1 -0
- package/build/common/utils/date-utils.js +12 -11
- package/build/common/utils/date-utils.js.map +1 -0
- package/build/common/utils/debounce.js +12 -15
- package/build/common/utils/debounce.js.map +1 -0
- package/build/common/utils/file-utils.js +13 -25
- package/build/common/utils/file-utils.js.map +1 -0
- package/build/common/utils/id-utils.js +5 -5
- package/build/common/utils/id-utils.js.map +1 -0
- package/build/common/utils/index.js +2 -1
- package/build/common/utils/index.js.map +1 -0
- package/build/common/utils/is-equal.js +9 -8
- package/build/common/utils/is-equal.js.map +1 -0
- package/build/common/utils/schema-utils.js +7 -6
- package/build/common/utils/schema-utils.js.map +1 -0
- package/build/common/utils/step-utils.js +15 -14
- package/build/common/utils/step-utils.js.map +1 -0
- package/build/common/validators/index.js +8 -7
- package/build/common/validators/index.js.map +1 -0
- package/build/common/validators/models/model-validators.js +9 -8
- package/build/common/validators/models/model-validators.js.map +1 -0
- package/build/common/validators/models/models.utils.js +30 -42
- package/build/common/validators/models/models.utils.js.map +1 -0
- package/build/common/validators/schemas/schema-validators.js +12 -13
- package/build/common/validators/schemas/schema-validators.js.map +1 -0
- package/build/common/validators/types/type-validators.js +10 -13
- package/build/common/validators/types/type-validators.js.map +1 -0
- package/build/common/validators/validationFailures/validation-failures.js +15 -14
- package/build/common/validators/validationFailures/validation-failures.js.map +1 -0
- package/build/common/validators/validationFailures/validation-failures.utils.js +6 -7
- package/build/common/validators/validationFailures/validation-failures.utils.js.map +1 -0
- package/build/common/validators/values/value-validators.js +5 -6
- package/build/common/validators/values/value-validators.js.map +1 -0
- package/build/dynamicFlow/DynamicFlow.js +186 -307
- package/build/dynamicFlow/DynamicFlow.js.map +1 -0
- package/build/dynamicFlow/DynamicFlowStep.js +13 -23
- package/build/dynamicFlow/DynamicFlowStep.js.map +1 -0
- package/build/dynamicFlow/DynamicFlowTypes.js +2 -1
- package/build/dynamicFlow/DynamicFlowTypes.js.map +1 -0
- package/build/dynamicFlow/index.js +7 -14
- package/build/dynamicFlow/index.js.map +1 -0
- package/build/dynamicFlow/stories/DynamicFlow.story.js +21 -20
- package/build/dynamicFlow/stories/DynamicFlow.story.js.map +1 -0
- package/build/dynamicFlow/stories/EditableDynamicFlow.js +21 -33
- package/build/dynamicFlow/stories/EditableDynamicFlow.js.map +1 -0
- package/build/dynamicFlow/stories/fixtureFetcher.js +47 -104
- package/build/dynamicFlow/stories/fixtureFetcher.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js +23 -40
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js +7 -6
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.js.map +1 -0
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js +11 -11
- package/build/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.js.map +1 -0
- package/build/dynamicFlow/utils/index.js +6 -2
- package/build/dynamicFlow/utils/index.js.map +1 -0
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js +54 -118
- package/build/dynamicFlow/utils/responseParsers/response-parsers.js.map +1 -0
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +10 -9
- package/build/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js.map +1 -0
- package/build/dynamicFlow/utils/useDynamicFlowState.js +52 -74
- package/build/dynamicFlow/utils/useDynamicFlowState.js.map +1 -0
- package/build/dynamicFlow/utils/useLoader.js +10 -20
- package/build/dynamicFlow/utils/useLoader.js.map +1 -0
- package/build/fixtures/components/alert.js +9 -8
- package/build/fixtures/components/alert.js.map +1 -0
- package/build/fixtures/components/box.js +8 -7
- package/build/fixtures/components/box.js.map +1 -0
- package/build/fixtures/components/button.js +26 -36
- package/build/fixtures/components/button.js.map +1 -0
- package/build/fixtures/components/columns.js +11 -10
- package/build/fixtures/components/columns.js.map +1 -0
- package/build/fixtures/components/copyable.js +7 -6
- package/build/fixtures/components/copyable.js.map +1 -0
- package/build/fixtures/components/decision.js +16 -15
- package/build/fixtures/components/decision.js.map +1 -0
- package/build/fixtures/components/heading.js +8 -7
- package/build/fixtures/components/heading.js.map +1 -0
- package/build/fixtures/components/image.js +11 -10
- package/build/fixtures/components/image.js.map +1 -0
- package/build/fixtures/components/index.js +18 -25
- package/build/fixtures/components/index.js.map +1 -0
- package/build/fixtures/components/info.js +23 -6
- package/build/fixtures/components/info.js.map +1 -0
- package/build/fixtures/components/list.js +9 -8
- package/build/fixtures/components/list.js.map +1 -0
- package/build/fixtures/components/loading-indicator.js +6 -5
- package/build/fixtures/components/loading-indicator.js.map +1 -0
- package/build/fixtures/components/paragraph.js +10 -9
- package/build/fixtures/components/paragraph.js.map +1 -0
- package/build/fixtures/components/review.js +12 -11
- package/build/fixtures/components/review.js.map +1 -0
- package/build/fixtures/examples/camera-capture.js +30 -29
- package/build/fixtures/examples/camera-capture.js.map +1 -0
- package/build/fixtures/examples/index.js +10 -17
- package/build/fixtures/examples/index.js.map +1 -0
- package/build/fixtures/examples/recipient-update.js +70 -69
- package/build/fixtures/examples/recipient-update.js.map +1 -0
- package/build/fixtures/examples/recipient.js +64 -63
- package/build/fixtures/examples/recipient.js.map +1 -0
- package/build/fixtures/examples/single-file-upload.js +22 -21
- package/build/fixtures/examples/single-file-upload.js.map +1 -0
- package/build/fixtures/examples/step-validation-errors.js +22 -21
- package/build/fixtures/examples/step-validation-errors.js.map +1 -0
- package/build/fixtures/features/action-response.js +9 -8
- package/build/fixtures/features/action-response.js.map +1 -0
- package/build/fixtures/features/external.js +9 -8
- package/build/fixtures/features/external.js.map +1 -0
- package/build/fixtures/features/index.js +10 -17
- package/build/fixtures/features/index.js.map +1 -0
- package/build/fixtures/features/persist-async.js +12 -11
- package/build/fixtures/features/persist-async.js.map +1 -0
- package/build/fixtures/features/polling.js +10 -9
- package/build/fixtures/features/polling.js.map +1 -0
- package/build/fixtures/features/validation-async.js +11 -10
- package/build/fixtures/features/validation-async.js.map +1 -0
- package/build/fixtures/index.js +12 -22
- package/build/fixtures/index.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/allOf.js +31 -30
- package/build/fixtures/jsonSchemaForm/allOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/audRecipient.js +272 -271
- package/build/fixtures/jsonSchemaForm/audRecipient.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/currency.js +13 -12
- package/build/fixtures/jsonSchemaForm/currency.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js +12 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBase64.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js +12 -11
- package/build/fixtures/jsonSchemaForm/multipleFileUploadBlob.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/oneOf.js +28 -27
- package/build/fixtures/jsonSchemaForm/oneOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js +17 -16
- package/build/fixtures/jsonSchemaForm/oneOfTabs.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js +18 -17
- package/build/fixtures/jsonSchemaForm/promotedOneOf.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js +31 -30
- package/build/fixtures/jsonSchemaForm/promotedOneOfCheckbox.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/simple.js +17 -16
- package/build/fixtures/jsonSchemaForm/simple.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js +20 -19
- package/build/fixtures/jsonSchemaForm/uploadPersistAsync.js.map +1 -0
- package/build/fixtures/jsonSchemaForm/validationAsync.js +9 -8
- package/build/fixtures/jsonSchemaForm/validationAsync.js.map +1 -0
- package/build/fixtures/layouts/all.js +38 -37
- package/build/fixtures/layouts/all.js.map +1 -0
- package/build/fixtures/layouts/final-step-layout.js +10 -9
- package/build/fixtures/layouts/final-step-layout.js.map +1 -0
- package/build/fixtures/layouts/index.js +11 -18
- package/build/fixtures/layouts/index.js.map +1 -0
- package/build/fixtures/layouts/list.js +11 -10
- package/build/fixtures/layouts/list.js.map +1 -0
- package/build/fixtures/layouts/pay-in.js +24 -23
- package/build/fixtures/layouts/pay-in.js.map +1 -0
- package/build/fixtures/layouts/review.js +39 -38
- package/build/fixtures/layouts/review.js.map +1 -0
- package/build/fixtures/layouts/success.js +16 -15
- package/build/fixtures/layouts/success.js.map +1 -0
- package/build/fixtures/responses/action-response-final.js +9 -8
- package/build/fixtures/responses/action-response-final.js.map +1 -0
- package/build/fixtures/responses/action.js +4 -3
- package/build/fixtures/responses/action.js.map +1 -0
- package/build/fixtures/responses/exit.js +4 -3
- package/build/fixtures/responses/exit.js.map +1 -0
- package/build/fixtures/responses/index.js +9 -16
- package/build/fixtures/responses/index.js.map +1 -0
- package/build/fixtures/responses/recipient-update-final.js +9 -8
- package/build/fixtures/responses/recipient-update-final.js.map +1 -0
- package/build/fixtures/schemas/basic-form.js +12 -11
- package/build/fixtures/schemas/basic-form.js.map +1 -0
- package/build/fixtures/schemas/index.js +9 -16
- package/build/fixtures/schemas/index.js.map +1 -0
- package/build/fixtures/schemas/number-and-integer.js +12 -11
- package/build/fixtures/schemas/number-and-integer.js.map +1 -0
- package/build/fixtures/schemas/one-of.js +44 -46
- package/build/fixtures/schemas/one-of.js.map +1 -0
- package/build/fixtures/schemas/string-formats.js +16 -15
- package/build/fixtures/schemas/string-formats.js.map +1 -0
- package/build/fixtures/utils/image-util.js +9 -8
- package/build/fixtures/utils/image-util.js.map +1 -0
- package/build/formControl/FormControl.js +119 -148
- package/build/formControl/FormControl.js.map +1 -0
- package/build/formControl/index.js +7 -14
- package/build/formControl/index.js.map +1 -0
- package/build/formControl/utils/index.js +2 -1
- package/build/formControl/utils/index.js.map +1 -0
- package/build/formControl/utils/value-utils.js +19 -23
- package/build/formControl/utils/value-utils.js.map +1 -0
- package/build/i18n/index.js +32 -31
- package/build/i18n/index.js.map +1 -0
- package/build/index.js +14 -10
- package/build/index.js.map +1 -0
- package/build/jsonSchemaForm/JsonSchemaForm.js +13 -24
- package/build/jsonSchemaForm/JsonSchemaForm.js.map +1 -0
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js +25 -37
- package/build/jsonSchemaForm/allOfSchema/AllOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/allOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/allOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +10 -20
- package/build/jsonSchemaForm/arrayTypeSchema/ArraySchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +10 -20
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +57 -115
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js +8 -7
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -1
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +20 -71
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +11 -11
- package/build/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js.map +1 -0
- package/build/jsonSchemaForm/arrayTypeSchema/index.js +7 -14
- package/build/jsonSchemaForm/arrayTypeSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +46 -62
- package/build/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js.map +1 -0
- package/build/jsonSchemaForm/basicTypeSchema/index.js +7 -14
- package/build/jsonSchemaForm/basicTypeSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js +40 -50
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js +19 -18
- package/build/jsonSchemaForm/controlFeedback/ControlFeedback.messages.js.map +1 -0
- package/build/jsonSchemaForm/controlFeedback/index.js +7 -14
- package/build/jsonSchemaForm/controlFeedback/index.js.map +1 -0
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js +53 -61
- package/build/jsonSchemaForm/genericSchema/GenericSchema.js.map +1 -0
- package/build/jsonSchemaForm/genericSchema/index.js +7 -14
- package/build/jsonSchemaForm/genericSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/help/Help.js +10 -9
- package/build/jsonSchemaForm/help/Help.js.map +1 -0
- package/build/jsonSchemaForm/help/Help.messages.js +6 -5
- package/build/jsonSchemaForm/help/Help.messages.js.map +1 -0
- package/build/jsonSchemaForm/help/index.js +7 -14
- package/build/jsonSchemaForm/help/index.js.map +1 -0
- package/build/jsonSchemaForm/index.js +7 -14
- package/build/jsonSchemaForm/index.js.map +1 -0
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js +29 -49
- package/build/jsonSchemaForm/objectSchema/ObjectSchema.js.map +1 -0
- package/build/jsonSchemaForm/objectSchema/index.js +7 -14
- package/build/jsonSchemaForm/objectSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js +55 -74
- package/build/jsonSchemaForm/oneOfSchema/OneOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/oneOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js +4 -3
- package/build/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js +2 -1
- package/build/jsonSchemaForm/oneOfSchema/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js +20 -20
- package/build/jsonSchemaForm/oneOfSchema/utils/one-of-utils.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +12 -22
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js +6 -5
- package/build/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +74 -127
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +46 -110
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +18 -17
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js.map +1 -0
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +7 -14
- package/build/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +29 -47
- package/build/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js +7 -14
- package/build/jsonSchemaForm/promotedOneOfSchema/index.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +5 -4
- package/build/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +14 -24
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +12 -22
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js.map +1 -0
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +13 -23
- package/build/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +25 -26
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +7 -6
- package/build/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js.map +1 -0
- package/build/jsonSchemaForm/readOnlySchema/index.js +7 -14
- package/build/jsonSchemaForm/readOnlySchema/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +27 -39
- package/build/jsonSchemaForm/schemaFormControl/SchemaFormControl.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/index.js +7 -14
- package/build/jsonSchemaForm/schemaFormControl/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js +6 -5
- package/build/jsonSchemaForm/schemaFormControl/utils/currency-utils.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js +2 -1
- package/build/jsonSchemaForm/schemaFormControl/utils/index.js.map +1 -0
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +31 -47
- package/build/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js.map +1 -0
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +58 -119
- package/build/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js.map +1 -0
- package/build/jsonSchemaForm/validationAsyncSchema/index.js +7 -14
- package/build/jsonSchemaForm/validationAsyncSchema/index.js.map +1 -0
- package/build/layout/DynamicLayout.js +11 -21
- package/build/layout/DynamicLayout.js.map +1 -0
- package/build/layout/alert/DynamicAlert.js +10 -9
- package/build/layout/alert/DynamicAlert.js.map +1 -0
- package/build/layout/box/DynamicBox.js +13 -23
- package/build/layout/box/DynamicBox.js.map +1 -0
- package/build/layout/button/DynamicButton.js +17 -27
- package/build/layout/button/DynamicButton.js.map +1 -0
- package/build/layout/columns/DynamicColumns.js +14 -24
- package/build/layout/columns/DynamicColumns.js.map +1 -0
- package/build/layout/decision/DynamicDecision.js +17 -27
- package/build/layout/decision/DynamicDecision.js.map +1 -0
- package/build/layout/divider/DynamicDivider.js +8 -8
- package/build/layout/divider/DynamicDivider.js.map +1 -0
- package/build/layout/external/DynamicExternal.js +17 -28
- package/build/layout/external/DynamicExternal.js.map +1 -0
- package/build/layout/external/DynamicExternal.messages.js +6 -5
- package/build/layout/external/DynamicExternal.messages.js.map +1 -0
- package/build/layout/form/DynamicForm.js +11 -21
- package/build/layout/form/DynamicForm.js.map +1 -0
- package/build/layout/heading/DynamicHeading.js +13 -23
- package/build/layout/heading/DynamicHeading.js.map +1 -0
- package/build/layout/icon/DynamicIcon.js +10 -10
- package/build/layout/icon/DynamicIcon.js.map +1 -0
- package/build/layout/image/DynamicImage.js +44 -93
- package/build/layout/image/DynamicImage.js.map +1 -0
- package/build/layout/index.js +22 -29
- package/build/layout/index.js.map +1 -0
- package/build/layout/info/DynamicInfo.js +8 -19
- package/build/layout/info/DynamicInfo.js.map +1 -0
- package/build/layout/list/DynamicList.js +15 -26
- package/build/layout/list/DynamicList.js.map +1 -0
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js +9 -9
- package/build/layout/loadingIndicator/DynamicLoadingIndicator.js.map +1 -0
- package/build/layout/paragraph/DynamicParagraph.js +20 -37
- package/build/layout/paragraph/DynamicParagraph.js.map +1 -0
- package/build/layout/paragraph/DynamicParagraph.messages.js +7 -6
- package/build/layout/paragraph/DynamicParagraph.messages.js.map +1 -0
- package/build/layout/paragraph/useSnackBarIfAvailable.js +5 -4
- package/build/layout/paragraph/useSnackBarIfAvailable.js.map +1 -0
- package/build/layout/review/DynamicReview.js +15 -26
- package/build/layout/review/DynamicReview.js.map +1 -0
- package/build/layout/utils.js +5 -6
- package/build/layout/utils.js.map +1 -0
- package/build/step/cameraStep/CameraStep.js +43 -88
- package/build/step/cameraStep/CameraStep.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.js +49 -105
- package/build/step/cameraStep/cameraCapture/CameraCapture.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js +8 -7
- package/build/step/cameraStep/cameraCapture/CameraCapture.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/components/index.js +11 -28
- package/build/step/cameraStep/cameraCapture/components/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/hooks/index.js +18 -72
- package/build/step/cameraStep/cameraCapture/hooks/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/index.js +7 -14
- package/build/step/cameraStep/cameraCapture/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js +34 -45
- package/build/step/cameraStep/cameraCapture/overlay/Overlay.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js +9 -19
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js +7 -6
- package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js +10 -21
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js +8 -7
- package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/screens/index.js +7 -14
- package/build/step/cameraStep/cameraCapture/screens/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/tracking/index.js +18 -99
- package/build/step/cameraStep/cameraCapture/tracking/index.js.map +1 -0
- package/build/step/cameraStep/cameraCapture/utils/index.js +34 -96
- package/build/step/cameraStep/cameraCapture/utils/index.js.map +1 -0
- package/build/step/cameraStep/index.js +7 -14
- package/build/step/cameraStep/index.js.map +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js +21 -21
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.js.map +1 -0
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js +9 -8
- package/build/step/externalConfirmationStep/ExternalConfirmationStep.messages.js.map +1 -0
- package/build/step/externalConfirmationStep/index.js +7 -14
- package/build/step/externalConfirmationStep/index.js.map +1 -0
- package/build/step/index.js +8 -15
- package/build/step/index.js.map +1 -0
- package/build/step/layoutStep/LayoutStep.js +20 -19
- package/build/step/layoutStep/LayoutStep.js.map +1 -0
- package/build/step/layoutStep/index.js +7 -14
- package/build/step/layoutStep/index.js.map +1 -0
- package/build/step/layoutStep/utils/index.js +4 -14
- package/build/step/layoutStep/utils/index.js.map +1 -0
- package/build/step/layoutStep/utils/inline-reference-utils.js +30 -46
- package/build/step/layoutStep/utils/inline-reference-utils.js.map +1 -0
- package/build/step/layoutStep/utils/layout-utils.js +35 -53
- package/build/step/layoutStep/utils/layout-utils.js.map +1 -0
- package/build/types/common/FormControl.js +2 -1
- package/build/types/common/FormControl.js.map +1 -0
- package/build/types/index.js +14 -13
- package/build/types/index.js.map +1 -0
- package/build/types/specification/Action.js +2 -1
- package/build/types/specification/Action.js.map +1 -0
- package/build/types/specification/FileUploadSchema.js +2 -1
- package/build/types/specification/FileUploadSchema.js.map +1 -0
- package/build/types/specification/LayoutComponent.js +2 -1
- package/build/types/specification/LayoutComponent.js.map +1 -0
- package/build/types/specification/Model.js +10 -17
- package/build/types/specification/Model.js.map +1 -0
- package/build/types/specification/PersistAsync.js +2 -1
- package/build/types/specification/PersistAsync.js.map +1 -0
- package/build/types/specification/Polling.js +2 -1
- package/build/types/specification/Polling.js.map +1 -0
- package/build/types/specification/Promotion.js +2 -1
- package/build/types/specification/Promotion.js.map +1 -0
- package/build/types/specification/Schema.js +9 -8
- package/build/types/specification/Schema.js.map +1 -0
- package/build/types/specification/Step.js +4 -5
- package/build/types/specification/Step.js.map +1 -0
- package/build/types/specification/ValidationAsync.js +2 -1
- package/build/types/specification/ValidationAsync.js.map +1 -0
- package/build/types/specification/core.js +2 -1
- package/build/types/specification/core.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,50 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
exports.__esModule = true;
|
|
14
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
4
|
/* eslint-disable fp/no-mutation */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var svgReference = (0, react_1.useRef)(null);
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const debounce_1 = require("../../../../common/utils/debounce");
|
|
7
|
+
const captureButtonHeight = 92;
|
|
8
|
+
const reviewButtonsHeight = 120;
|
|
9
|
+
const imageHeight = 40;
|
|
10
|
+
const titleHeight = 32;
|
|
11
|
+
const instructionsHeight = 48;
|
|
12
|
+
const reviewInstructionsHeight = 40;
|
|
13
|
+
const overlayMaxWidth = 800;
|
|
14
|
+
const Overlay = ({ overlay, outline, imageUrl, title, instructions, reviewInstructions, }) => {
|
|
15
|
+
const svgReference = (0, react_1.useRef)(null);
|
|
28
16
|
/*
|
|
29
17
|
SVG doesn't always rerender when screen orientation changes,
|
|
30
18
|
so need to force rerender
|
|
31
19
|
*/
|
|
32
|
-
(0, react_1.useEffect)(
|
|
33
|
-
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
const listener = (0, debounce_1.debounce)(() => {
|
|
34
22
|
var _a;
|
|
35
23
|
if ((_a = svgReference.current) === null || _a === void 0 ? void 0 : _a.innerHTML) {
|
|
36
|
-
|
|
24
|
+
const reference = svgReference.current;
|
|
37
25
|
reference.innerHTML += '';
|
|
38
26
|
}
|
|
39
27
|
}, 100);
|
|
40
28
|
window.addEventListener('resize', listener);
|
|
41
|
-
return
|
|
29
|
+
return () => window.removeEventListener('resize', listener);
|
|
42
30
|
});
|
|
43
|
-
|
|
31
|
+
let helperBoxHeight = (imageUrl ? imageHeight : 0) +
|
|
44
32
|
(title ? titleHeight : 0) +
|
|
45
33
|
(instructions ? instructionsHeight : 0);
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
let helperBox = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [imageUrl && (0, jsx_runtime_1.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }), title && (0, jsx_runtime_1.jsx)("h4", Object.assign({ className: "camera-capture-title" }, { children: title })), instructions && (0, jsx_runtime_1.jsx)("small", Object.assign({ className: "camera-capture-instructions" }, { children: instructions }))] }));
|
|
35
|
+
const frameBottomMargin = captureButtonHeight + helperBoxHeight;
|
|
48
36
|
/*
|
|
49
37
|
frameBottomMargin needs to stay the same for the review page so that
|
|
50
38
|
the overlay position does not change! Basically if it is the review step
|
|
@@ -54,27 +42,28 @@ var Overlay = function (_a) {
|
|
|
54
42
|
*/
|
|
55
43
|
if (reviewInstructions) {
|
|
56
44
|
helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
|
|
57
|
-
helperBox = (0, jsx_runtime_1.jsx)("small",
|
|
58
|
-
|
|
45
|
+
helperBox = (0, jsx_runtime_1.jsx)("small", Object.assign({ className: "camera-capture-instructions" }, { children: reviewInstructions }));
|
|
46
|
+
const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
|
|
59
47
|
if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
|
|
60
48
|
helperBox = (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
61
49
|
}
|
|
62
50
|
}
|
|
63
|
-
|
|
51
|
+
const framePosition = {
|
|
64
52
|
x: '50%',
|
|
65
53
|
y: '5%',
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
68
|
-
style: { transform:
|
|
54
|
+
width: `min(90%, ${overlayMaxWidth}px)`,
|
|
55
|
+
height: `calc(90% - ${frameBottomMargin}px)`,
|
|
56
|
+
style: { transform: `translateX(max(-45%, -${overlayMaxWidth / 2}px))` },
|
|
69
57
|
};
|
|
70
|
-
|
|
58
|
+
const helperBoxPosition = {
|
|
71
59
|
style: {
|
|
72
60
|
left: '5%',
|
|
73
|
-
top:
|
|
74
|
-
height:
|
|
75
|
-
width: '90%'
|
|
76
|
-
}
|
|
61
|
+
top: `calc(100% - ${frameBottomMargin}px - 5%)`,
|
|
62
|
+
height: `calc(${helperBoxHeight}px + 5%)`,
|
|
63
|
+
width: '90%',
|
|
64
|
+
},
|
|
77
65
|
};
|
|
78
|
-
return ((0, jsx_runtime_1.jsxs)("svg",
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ ref: svgReference, xmlns: "http://www.w3.org/2000/svg" }, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("mask", Object.assign({ id: "mask" }, { children: [(0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }), (0, jsx_runtime_1.jsx)("image", Object.assign({ href: overlay }, framePosition))] })) }), overlay && (0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }), outline && (0, jsx_runtime_1.jsx)("image", Object.assign({ href: outline }, framePosition)), (0, jsx_runtime_1.jsx)("foreignObject", Object.assign({ width: "100%", height: "100%" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "camera-capture-text-and-image-container" }, helperBoxPosition, { children: helperBox })) }))] })));
|
|
79
67
|
};
|
|
80
|
-
exports
|
|
68
|
+
exports.default = Overlay;
|
|
69
|
+
//# sourceMappingURL=Overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../../../../../src/step/cameraStep/cameraCapture/overlay/Overlay.tsx"],"names":[],"mappings":"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"}
|
package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)("div",
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_intl_1 = require("react-intl");
|
|
8
|
+
const CameraNotSupported_messages_1 = __importDefault(require("./CameraNotSupported.messages"));
|
|
9
|
+
const CameraNotSupported = () => {
|
|
10
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ id: "camera-not-supported" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "container p-t-5" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "row" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "col-md-6 col-md-offset-3" }, { children: [(0, jsx_runtime_1.jsx)("h2", Object.assign({ className: "text-xs-center m-b-3" }, { children: intl.formatMessage(CameraNotSupported_messages_1.default.title) })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "text-xs-center m-b-5" }, { children: intl.formatMessage(CameraNotSupported_messages_1.default.paragraph) }))] })) })) })) })));
|
|
23
12
|
};
|
|
24
|
-
exports
|
|
13
|
+
exports.default = CameraNotSupported;
|
|
14
|
+
//# sourceMappingURL=CameraNotSupported.js.map
|
package/build/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraNotSupported.js","sourceRoot":"","sources":["../../../../../../src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx"],"names":[],"mappings":";;;;;;AAAA,2CAAqC;AAErC,gGAAqD;AAErD,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,IAAI,GAAG,IAAA,oBAAO,GAAE,CAAC;IAEvB,OAAO,CACL,8CAAK,EAAE,EAAC,sBAAsB,gBAC5B,8CAAK,SAAS,EAAC,iBAAiB,gBAC9B,8CAAK,SAAS,EAAC,KAAK,gBAClB,+CAAK,SAAS,EAAC,0BAA0B,iBACvC,6CAAI,SAAS,EAAC,sBAAsB,gBAAE,IAAI,CAAC,aAAa,CAAC,qCAAQ,CAAC,KAAK,CAAC,IAAM,EAC9E,4CAAG,SAAS,EAAC,sBAAsB,gBAAE,IAAI,CAAC,aAAa,CAAC,qCAAQ,CAAC,SAAS,CAAC,IAAK,KAC5E,IACF,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
5
|
title: {
|
|
6
6
|
id: 'dynamicFlows.CameraCapture.CameraNotSupported.title',
|
|
7
7
|
defaultMessage: 'Camera not supported',
|
|
8
|
-
description: 'Title of standalone page prompting that camera is not available on users browser'
|
|
8
|
+
description: 'Title of standalone page prompting that camera is not available on users browser',
|
|
9
9
|
},
|
|
10
10
|
paragraph: {
|
|
11
11
|
id: 'dynamicFlows.CameraCapture.CameraNotSupported.paragraph',
|
|
12
12
|
defaultMessage: "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.",
|
|
13
|
-
description: "Further text of standalone page prompting that camera is not available on user's browser"
|
|
14
|
-
}
|
|
13
|
+
description: "Further text of standalone page prompting that camera is not available on user's browser",
|
|
14
|
+
},
|
|
15
15
|
});
|
|
16
|
+
//# sourceMappingURL=CameraNotSupported.messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraNotSupported.messages.js","sourceRoot":"","sources":["../../../../../../src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.ts"],"names":[],"mappings":";;AAAA,2CAA4C;AAE5C,kBAAe,IAAA,2BAAc,EAAC;IAC5B,KAAK,EAAE;QACL,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,kFAAkF;KAChG;IACD,SAAS,EAAE;QACT,EAAE,EAAE,yDAAyD;QAC7D,cAAc,EACZ,0HAA0H;QAC5H,WAAW,EACT,0FAA0F;KAC7F;CACF,CAAC,CAAC"}
|
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
|
-
exports
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)("div", __assign({ id: "no-camera-access" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "container p-t-5" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "row" }, { children: (0, jsx_runtime_1.jsxs)("div", __assign({ className: "col-md-6 col-md-offset-3" }, { children: [(0, jsx_runtime_1.jsx)("h2", __assign({ className: "text-xs-center m-b-3" }, { children: intl.formatMessage(NoCameraAccess_messages_1["default"].title) })), (0, jsx_runtime_1.jsx)("p", __assign({ className: "text-xs-center m-b-5" }, { children: intl.formatMessage(NoCameraAccess_messages_1["default"].paragraph) })), (0, jsx_runtime_1.jsx)(components_1.Button, __assign({ block: true, onClick: onAction }, { children: intl.formatMessage(NoCameraAccess_messages_1["default"].action) }))] })) })) })) })));
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const components_1 = require("@transferwise/components");
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const NoCameraAccess_messages_1 = __importDefault(require("./NoCameraAccess.messages"));
|
|
10
|
+
const NoCameraAccess = ({ onAction }) => {
|
|
11
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ id: "no-camera-access" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "container p-t-5" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "row" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "col-md-6 col-md-offset-3" }, { children: [(0, jsx_runtime_1.jsx)("h2", Object.assign({ className: "text-xs-center m-b-3" }, { children: intl.formatMessage(NoCameraAccess_messages_1.default.title) })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "text-xs-center m-b-5" }, { children: intl.formatMessage(NoCameraAccess_messages_1.default.paragraph) })), (0, jsx_runtime_1.jsx)(components_1.Button, Object.assign({ block: true, onClick: onAction }, { children: intl.formatMessage(NoCameraAccess_messages_1.default.action) }))] })) })) })) })));
|
|
25
13
|
};
|
|
26
|
-
exports
|
|
14
|
+
exports.default = NoCameraAccess;
|
|
15
|
+
//# sourceMappingURL=NoCameraAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoCameraAccess.js","sourceRoot":"","sources":["../../../../../../src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx"],"names":[],"mappings":";;;;;;AAAA,yDAAkD;AAClD,2CAAqC;AAErC,wFAAiD;AAIjD,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IAC7C,MAAM,IAAI,GAAG,IAAA,oBAAO,GAAE,CAAC;IAEvB,OAAO,CACL,8CAAK,EAAE,EAAC,kBAAkB,gBACxB,8CAAK,SAAS,EAAC,iBAAiB,gBAC9B,8CAAK,SAAS,EAAC,KAAK,gBAClB,+CAAK,SAAS,EAAC,0BAA0B,iBACvC,6CAAI,SAAS,EAAC,sBAAsB,gBAAE,IAAI,CAAC,aAAa,CAAC,iCAAQ,CAAC,KAAK,CAAC,IAAM,EAC9E,4CAAG,SAAS,EAAC,sBAAsB,gBAAE,IAAI,CAAC,aAAa,CAAC,iCAAQ,CAAC,SAAS,CAAC,IAAK,EAChF,uBAAC,mBAAM,kBAAC,KAAK,QAAC,OAAO,EAAE,QAAQ,gBAC5B,IAAI,CAAC,aAAa,CAAC,iCAAQ,CAAC,MAAM,CAAC,IAC7B,KACL,IACF,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_intl_1 = require("react-intl");
|
|
4
|
+
exports.default = (0, react_intl_1.defineMessages)({
|
|
5
5
|
title: {
|
|
6
6
|
id: 'dynamicFlows.CameraCapture.NoCameraAccess.title',
|
|
7
7
|
defaultMessage: "We can't access your camera",
|
|
8
|
-
description: 'Title of standalone page prompting missing camera permissions'
|
|
8
|
+
description: 'Title of standalone page prompting missing camera permissions',
|
|
9
9
|
},
|
|
10
10
|
paragraph: {
|
|
11
11
|
id: 'dynamicFlows.CameraCapture.NoCameraAccess.paragraph',
|
|
12
12
|
defaultMessage: "Enable camera access in your browser's settings to get going again.",
|
|
13
|
-
description: 'Further text of standalone page prompting missing camera permissions'
|
|
13
|
+
description: 'Further text of standalone page prompting missing camera permissions',
|
|
14
14
|
},
|
|
15
15
|
action: {
|
|
16
16
|
id: 'dynamicFlows.CameraCapture.NoCameraAccess.action',
|
|
17
17
|
defaultMessage: 'Enable camera access',
|
|
18
|
-
description: 'Action to ask for camera permissions again'
|
|
19
|
-
}
|
|
18
|
+
description: 'Action to ask for camera permissions again',
|
|
19
|
+
},
|
|
20
20
|
});
|
|
21
|
+
//# sourceMappingURL=NoCameraAccess.messages.js.map
|
package/build/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoCameraAccess.messages.js","sourceRoot":"","sources":["../../../../../../src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.ts"],"names":[],"mappings":";;AAAA,2CAA4C;AAE5C,kBAAe,IAAA,2BAAc,EAAC;IAC5B,KAAK,EAAE;QACL,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,6BAA6B;QAC7C,WAAW,EAAE,+DAA+D;KAC7E;IACD,SAAS,EAAE;QACT,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,qEAAqE;QACrF,WAAW,EAAE,sEAAsE;KACpF;IACD,MAAM,EAAE;QACN,EAAE,EAAE,kDAAkD;QACtD,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
exports.__esModule = true;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
6
|
exports.CameraNotSupported = exports.NoCameraAccess = void 0;
|
|
15
7
|
var NoCameraAccess_1 = require("./NoCameraAccess/NoCameraAccess");
|
|
16
|
-
|
|
8
|
+
Object.defineProperty(exports, "NoCameraAccess", { enumerable: true, get: function () { return __importDefault(NoCameraAccess_1).default; } });
|
|
17
9
|
var CameraNotSupported_1 = require("./CameraNotSupported/CameraNotSupported");
|
|
18
|
-
|
|
10
|
+
Object.defineProperty(exports, "CameraNotSupported", { enumerable: true, get: function () { return __importDefault(CameraNotSupported_1).default; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/step/cameraStep/cameraCapture/screens/index.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA4E;AAAnE,iIAAA,OAAO,OAAkB;AAClC,8EAAwF;AAA/E,yIAAA,OAAO,OAAsB"}
|
|
@@ -1,104 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
3
|
exports.trackCameraNotSupported = exports.trackCameraFeedStarted = exports.trackCameraPermissionDenied = void 0;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Camera Permission Denied', {});
|
|
54
|
-
};
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const trackCameraPermissionDenied = (onEvent) => onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Camera Permission Denied', {});
|
|
55
6
|
exports.trackCameraPermissionDenied = trackCameraPermissionDenied;
|
|
56
|
-
|
|
57
|
-
switch (_d.label) {
|
|
58
|
-
case 0:
|
|
59
|
-
if (!(onEvent === null || onEvent === void 0)) return [3 /*break*/, 1];
|
|
60
|
-
_a = void 0;
|
|
61
|
-
return [3 /*break*/, 3];
|
|
62
|
-
case 1:
|
|
63
|
-
_b = onEvent;
|
|
64
|
-
_c = ['Dynamic Flow - Camera Feed Started'];
|
|
65
|
-
return [4 /*yield*/, getCameraStartedProperties(props, stream)];
|
|
66
|
-
case 2:
|
|
67
|
-
_a = _b.apply(void 0, _c.concat([_d.sent()]));
|
|
68
|
-
_d.label = 3;
|
|
69
|
-
case 3: return [2 /*return*/, _a];
|
|
70
|
-
}
|
|
71
|
-
}); }); };
|
|
7
|
+
const trackCameraFeedStarted = async (onEvent, props, stream) => onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Camera Feed Started', await getCameraStartedProperties(props, stream));
|
|
72
8
|
exports.trackCameraFeedStarted = trackCameraFeedStarted;
|
|
73
|
-
|
|
9
|
+
const trackCameraNotSupported = (onEvent, error) => onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Camera Not Supported', { Error: error });
|
|
74
10
|
exports.trackCameraNotSupported = trackCameraNotSupported;
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_e = {};
|
|
89
|
-
_c = 'Available Video Devices (by label)';
|
|
90
|
-
return [4 /*yield*/, (0, utils_1.getAvailableVideoDeviceLabels)()];
|
|
91
|
-
case 1:
|
|
92
|
-
_e[_c] = _g.sent();
|
|
93
|
-
_d = 'Active Video Device (by label)';
|
|
94
|
-
return [4 /*yield*/, (0, utils_1.getActiveVideoDeviceLabel)(videoStream)];
|
|
95
|
-
case 2:
|
|
96
|
-
_b = (_e[_d] = _g.sent(),
|
|
97
|
-
_e['Camera Capabilities'] = capabilities,
|
|
98
|
-
_e['Camera Settings'] = settings,
|
|
99
|
-
_e);
|
|
100
|
-
_g.label = 3;
|
|
101
|
-
case 3: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b)])), { 'Camera Direction (Asked)': props === null || props === void 0 ? void 0 : props.direction }])];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}); };
|
|
11
|
+
const getCameraStartedProperties = async (props, videoStream) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const videoTrack = (0, utils_1.getVideoTrack)(videoStream);
|
|
14
|
+
const capabilities = (0, utils_1.getVideoCapabilities)(videoStream);
|
|
15
|
+
const settings = (_a = videoTrack === null || videoTrack === void 0 ? void 0 : videoTrack.getSettings) === null || _a === void 0 ? void 0 : _a.call(videoTrack);
|
|
16
|
+
return Object.assign(Object.assign({}, (videoTrack && {
|
|
17
|
+
'Available Video Devices (by label)': await (0, utils_1.getAvailableVideoDeviceLabels)(),
|
|
18
|
+
'Active Video Device (by label)': await (0, utils_1.getActiveVideoDeviceLabel)(videoStream),
|
|
19
|
+
'Camera Capabilities': capabilities,
|
|
20
|
+
'Camera Settings': settings,
|
|
21
|
+
})), { 'Camera Direction (Asked)': props === null || props === void 0 ? void 0 : props.direction });
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/step/cameraStep/cameraCapture/tracking/index.ts"],"names":[],"mappings":";;;AAEA,oCAKkB;AAEX,MAAM,2BAA2B,GAAG,CAAC,OAAiC,EAAE,EAAE,CAC/E,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,yCAAyC,EAAE,EAAE,CAAC,CAAC;AAD9C,QAAA,2BAA2B,+BACmB;AAEpD,MAAM,sBAAsB,GAAG,KAAK,EACzC,OAAiC,EACjC,KAAsC,EACtC,MAAmB,EACnB,EAAE,CACF,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,oCAAoC,EAAE,MAAM,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AALtF,QAAA,sBAAsB,0BAKgE;AAE5F,MAAM,uBAAuB,GAAG,CACrC,OAAiC,EACjC,KAA4B,EAC5B,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,qCAAqC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAH3D,QAAA,uBAAuB,2BAGoC;AAExE,MAAM,0BAA0B,GAAG,KAAK,EACtC,KAAsC,EACtC,WAAwB,EACxB,EAAE;;IACF,MAAM,UAAU,GAAiC,IAAA,qBAAa,EAAC,WAAW,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAuC,IAAA,4BAAoB,EAAC,WAAW,CAAC,CAAC;IAC3F,MAAM,QAAQ,GAAmC,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,0DAAI,CAAC;IAE7E,uCACK,CAAC,UAAU,IAAI;QAChB,oCAAoC,EAAE,MAAM,IAAA,qCAA6B,GAAE;QAC3E,gCAAgC,EAAE,MAAM,IAAA,iCAAyB,EAAC,WAAW,CAAC;QAE9E,qBAAqB,EAAE,YAAY;QACnC,iBAAiB,EAAE,QAAQ;KAC5B,CAAC,KACF,0BAA0B,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,IAC5C;AACJ,CAAC,CAAC"}
|
|
@@ -1,114 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.getVideoCapabilities = exports.getVideoTrack = exports.getActiveVideoDeviceLabel = exports.getAvailableVideoDeviceLabels = exports.getAvailableVideoDevices = exports.generateCanvasFromVideo = exports.isMainBackCamera = exports.isSelfieCamera = void 0;
|
|
40
|
-
|
|
4
|
+
const isSelfieCamera = (stream) => {
|
|
41
5
|
var _a;
|
|
42
|
-
|
|
6
|
+
const { facingMode } = ((_a = (0, exports.getVideoTrack)(stream)) === null || _a === void 0 ? void 0 : _a.getSettings()) || {};
|
|
43
7
|
// facingMode === undefined for desktop users
|
|
44
8
|
return facingMode === 'user' || facingMode === undefined;
|
|
45
9
|
};
|
|
46
10
|
exports.isSelfieCamera = isSelfieCamera;
|
|
47
|
-
|
|
48
|
-
return !!((deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.label) || '').match(/camera2? 0/g);
|
|
49
|
-
};
|
|
11
|
+
const isMainBackCamera = (deviceInfo) => !!((deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.label) || '').match(/camera2? 0/g);
|
|
50
12
|
exports.isMainBackCamera = isMainBackCamera;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (!context) return [3 /*break*/, 2];
|
|
62
|
-
// Timeout is needed for intermittent iOS issue
|
|
63
|
-
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 100); })];
|
|
64
|
-
case 1:
|
|
65
|
-
// Timeout is needed for intermittent iOS issue
|
|
66
|
-
_a.sent();
|
|
67
|
-
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
68
|
-
_a.label = 2;
|
|
69
|
-
case 2: return [2 /*return*/, canvas];
|
|
13
|
+
const generateCanvasFromVideo = async (video) => {
|
|
14
|
+
const canvas = document.createElement('canvas');
|
|
15
|
+
if (video) {
|
|
16
|
+
canvas.setAttribute('height', `${video.videoHeight}`);
|
|
17
|
+
canvas.setAttribute('width', `${video.videoWidth}`);
|
|
18
|
+
const context = canvas === null || canvas === void 0 ? void 0 : canvas.getContext('2d');
|
|
19
|
+
if (context) {
|
|
20
|
+
// Timeout is needed for intermittent iOS issue
|
|
21
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
22
|
+
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
70
23
|
}
|
|
71
|
-
}
|
|
72
|
-
|
|
24
|
+
}
|
|
25
|
+
return canvas;
|
|
26
|
+
};
|
|
73
27
|
exports.generateCanvasFromVideo = generateCanvasFromVideo;
|
|
74
|
-
|
|
28
|
+
const getAvailableVideoDevices = async () => {
|
|
75
29
|
var _a, _b;
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
case 0: return [4 /*yield*/, ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))];
|
|
79
|
-
case 1: return [2 /*return*/, ((_c.sent()) || []).filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}); };
|
|
30
|
+
return ((await ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))) || []).filter((deviceInfo) => deviceInfo.kind === 'videoinput');
|
|
31
|
+
};
|
|
83
32
|
exports.getAvailableVideoDevices = getAvailableVideoDevices;
|
|
84
|
-
|
|
33
|
+
const getAvailableVideoDeviceLabels = async () => {
|
|
85
34
|
var _a, _b;
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })
|
|
91
|
-
.map(function (deviceInfo) { return deviceInfo.label; })];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}); };
|
|
35
|
+
return ((await ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))) || [])
|
|
36
|
+
.filter((deviceInfo) => deviceInfo.kind === 'videoinput')
|
|
37
|
+
.map((deviceInfo) => deviceInfo.label);
|
|
38
|
+
};
|
|
95
39
|
exports.getAvailableVideoDeviceLabels = getAvailableVideoDeviceLabels;
|
|
96
|
-
|
|
97
|
-
var capabilities;
|
|
40
|
+
const getActiveVideoDeviceLabel = async (videoStream) => {
|
|
98
41
|
var _a, _b, _c;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
case 1: return [2 /*return*/, (_c = ((_d.sent()) || [])
|
|
105
|
-
.filter(function (deviceInfo) { return deviceInfo.kind === 'videoinput'; })
|
|
106
|
-
.find(function (deviceInfo) { return deviceInfo.deviceId === (capabilities === null || capabilities === void 0 ? void 0 : capabilities.deviceId); })) === null || _c === void 0 ? void 0 : _c.label];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}); };
|
|
42
|
+
const capabilities = (0, exports.getVideoCapabilities)(videoStream);
|
|
43
|
+
return (_c = ((await ((_b = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices) === null || _b === void 0 ? void 0 : _b.call(_a))) || [])
|
|
44
|
+
.filter((deviceInfo) => deviceInfo.kind === 'videoinput')
|
|
45
|
+
.find((deviceInfo) => deviceInfo.deviceId === (capabilities === null || capabilities === void 0 ? void 0 : capabilities.deviceId))) === null || _c === void 0 ? void 0 : _c.label;
|
|
46
|
+
};
|
|
110
47
|
exports.getActiveVideoDeviceLabel = getActiveVideoDeviceLabel;
|
|
111
|
-
|
|
48
|
+
const getVideoTrack = (videoStream) => { var _a; return (((_a = videoStream === null || videoStream === void 0 ? void 0 : videoStream.getVideoTracks) === null || _a === void 0 ? void 0 : _a.call(videoStream)) || [])[0]; };
|
|
112
49
|
exports.getVideoTrack = getVideoTrack;
|
|
113
|
-
|
|
50
|
+
const getVideoCapabilities = (videoStream) => { var _a, _b; return (_b = (_a = (0, exports.getVideoTrack)(videoStream)) === null || _a === void 0 ? void 0 : _a.getCapabilities) === null || _b === void 0 ? void 0 : _b.call(_a); };
|
|
114
51
|
exports.getVideoCapabilities = getVideoCapabilities;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/step/cameraStep/cameraCapture/utils/index.ts"],"names":[],"mappings":"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"}
|