@wise/dynamic-flow-client 3.9.0 → 3.9.1-experimental-152372b
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/errorBoundary/ErrorBoundary.js +44 -0
- package/build/common/errorBoundary/ErrorBoundaryAlert.js +12 -0
- package/build/common/httpClientContext/HttpClientContext.js +24 -0
- package/build/common/httpClientContext/index.js +1 -0
- package/build/common/makeHttpClient/index.js +1 -0
- package/build/common/makeHttpClient/makeHttpClient.js +34 -0
- package/build/common/makeHttpClient/makeHttpClient.spec.js +141 -0
- package/build/common/messages/external-confirmation.messages.js +23 -0
- package/build/common/messages/generic-error.messages.js +18 -0
- package/build/common/messages/help.messages.js +8 -0
- package/build/common/messages/multi-file-upload.messages.js +18 -0
- package/build/common/messages/multi-select.messages.js +8 -0
- package/build/common/messages/paragraph.messages.js +13 -0
- package/build/common/messages/repeatable.messages.js +23 -0
- package/build/common/messages/validation.array.messages.js +13 -0
- package/build/common/messages/validation.messages.js +53 -0
- package/build/common/utils/api-utils.js +4 -0
- package/build/i18n/de.json +46 -46
- package/build/i18n/en.json +46 -46
- package/build/i18n/es.json +46 -46
- package/build/i18n/fr.json +46 -46
- package/build/i18n/hu.json +46 -46
- package/build/i18n/id.json +46 -46
- package/build/i18n/index.js +36 -0
- package/build/i18n/it.json +46 -46
- package/build/i18n/ja.json +46 -46
- package/build/i18n/pl.json +46 -46
- package/build/i18n/pt.json +46 -46
- package/build/i18n/ro.json +46 -46
- package/build/i18n/ru.json +46 -46
- package/build/i18n/th.json +46 -46
- package/build/i18n/tr.json +46 -46
- package/build/i18n/zh_CN.json +46 -46
- package/build/i18n/zh_HK.json +46 -46
- package/build/index.js +11 -0
- package/build/legacy/common/constants/DateMode.js +4 -0
- package/build/legacy/common/constants/FeatureName.js +4 -0
- package/build/legacy/common/constants/FormControlType.js +21 -0
- package/build/legacy/common/constants/MonthFormat.js +4 -0
- package/build/legacy/common/constants/Size.js +7 -0
- package/build/legacy/common/constants/index.js +4 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.js +25 -0
- package/build/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.js +15 -0
- package/build/legacy/common/contexts/eventsContext/EventsContext.js +38 -0
- package/build/legacy/common/contexts/eventsContext/EventsContext.spec.js +47 -0
- package/build/legacy/common/contexts/featureContext/FeatureContext.js +11 -0
- package/build/legacy/common/contexts/featureContext/FeatureContext.spec.js +30 -0
- package/build/legacy/common/contexts/index.js +3 -0
- package/build/legacy/common/contexts/logContext/LogContext.js +44 -0
- package/build/legacy/common/contexts/logContext/LogContext.spec.js +43 -0
- package/build/legacy/common/hooks/index.js +7 -0
- package/build/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.js +9 -0
- package/build/legacy/common/hooks/useDebouncedFunction/useDebouncedFunction.spec.js +59 -0
- package/build/legacy/common/hooks/useExternal/useExternal.js +15 -0
- package/build/legacy/common/hooks/useExternal/useExternal.spec.js +236 -0
- package/build/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.js +71 -0
- package/build/legacy/common/hooks/usePersistAsync/usePersistAsync.js +172 -0
- package/build/legacy/common/hooks/usePolling/usePolling.js +53 -0
- package/build/legacy/common/hooks/usePrevious/usePrevious.js +8 -0
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.js +45 -0
- package/build/legacy/common/hooks/useStepPolling/useStepPolling.spec.js +288 -0
- package/build/legacy/common/messages.js +8 -0
- package/build/legacy/common/utils/api-utils.js +6 -0
- package/build/legacy/common/utils/date-utils.js +22 -0
- package/build/legacy/common/utils/debounce.js +39 -0
- package/build/legacy/common/utils/debounce.spec.js +72 -0
- package/build/legacy/common/utils/file-utils.js +45 -0
- package/build/legacy/common/utils/file-utils.spec.js +69 -0
- package/build/legacy/common/utils/id-utils.js +5 -0
- package/build/legacy/common/utils/id-utils.spec.js +12 -0
- package/build/legacy/common/utils/index.js +11 -0
- package/build/legacy/common/utils/is-equal.js +21 -0
- package/build/legacy/common/utils/is-equal.spec.js +88 -0
- package/build/legacy/common/utils/misc-utils.js +4 -0
- package/build/legacy/common/utils/mobile-utils.js +23 -0
- package/build/legacy/common/utils/mobile-utils.spec.js +71 -0
- package/build/legacy/common/utils/model-utils.js +33 -0
- package/build/legacy/common/utils/schema-utils.js +113 -0
- package/build/legacy/common/utils/step-utils.js +32 -0
- package/build/legacy/common/validators/index.js +5 -0
- package/build/legacy/common/validators/models/model-utils.js +119 -0
- package/build/legacy/common/validators/models/model-utils.spec.js +45 -0
- package/build/legacy/common/validators/models/model-validators.js +62 -0
- package/build/legacy/common/validators/models/model-validators.spec.js +647 -0
- package/build/legacy/common/validators/schemas/schema-validators.js +101 -0
- package/build/legacy/common/validators/schemas/schema-validators.spec.js +157 -0
- package/build/legacy/common/validators/types/type-validators.js +14 -0
- package/build/legacy/common/validators/types/type-validators.spec.js +147 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.js +139 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.spec.js +198 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.utils.js +40 -0
- package/build/legacy/common/validators/validationFailures/validation-failures.utils.spec.js +145 -0
- package/build/legacy/common/validators/values/value-validators.js +6 -0
- package/build/legacy/common/validators/values/value-validators.spec.js +22 -0
- package/build/legacy/dynamic-flow-types.js +1 -0
- package/build/legacy/dynamicFlow/BackButton.js +22 -0
- package/build/legacy/dynamicFlow/DynamicFlow.js +345 -0
- package/build/legacy/dynamicFlow/DynamicFlowStep.js +37 -0
- package/build/legacy/dynamicFlow/DynamicFlowTypes.js +1 -0
- package/build/legacy/dynamicFlow/index.js +1 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/DynamicFlow.story.js +78 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/ErrorResponses.story.js +124 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/Examples.story.js +25 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/Features.story.js +33 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/JsonSchemaForm.story.js +31 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/RefreshOnChange.story.js +194 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/SearchFeature.story.js +253 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/ServerTest.story.js +44 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/Upload.story.js +212 -0
- package/build/legacy/dynamicFlow/stories/dev-tools/ValidationAsync.story.js +156 -0
- package/build/legacy/dynamicFlow/stories/examples/ObjectConst.story.js +150 -0
- package/build/legacy/dynamicFlow/stories/fixtureHttpClient.js +117 -0
- package/build/legacy/dynamicFlow/stories/visual-tests/VisualTests.story.js +43 -0
- package/build/legacy/dynamicFlow/tests/Actions.spec.js +185 -0
- package/build/legacy/dynamicFlow/tests/AllOfSchema.spec.js +196 -0
- package/build/legacy/dynamicFlow/tests/AutocompleteHints.spec.js +59 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.BackButton.spec.js +179 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.search.spec.js +475 -0
- package/build/legacy/dynamicFlow/tests/DynamicFlow.spec.js +559 -0
- package/build/legacy/dynamicFlow/tests/DynamicImage.spec.js +287 -0
- package/build/legacy/dynamicFlow/tests/DynamicInstructions.spec.js +49 -0
- package/build/legacy/dynamicFlow/tests/HiddenSchemas.spec.js +307 -0
- package/build/legacy/dynamicFlow/tests/ModalLayout.spec.js +252 -0
- package/build/legacy/dynamicFlow/tests/MultiSelect.spec.js +327 -0
- package/build/legacy/dynamicFlow/tests/MultipleFileUploadSchema.spec.js +401 -0
- package/build/legacy/dynamicFlow/tests/ObjectSchema.spec.js +295 -0
- package/build/legacy/dynamicFlow/tests/OneOfSchema.spec.js +773 -0
- package/build/legacy/dynamicFlow/tests/PersistAsync.blob-schema.spec.js +331 -0
- package/build/legacy/dynamicFlow/tests/PersistAsync.string-schema.spec.js +389 -0
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.debouncing.spec.js +391 -0
- package/build/legacy/dynamicFlow/tests/RefreshStepOnChange.spec.js +567 -0
- package/build/legacy/dynamicFlow/tests/RepeatableSchema.spec.js +977 -0
- package/build/legacy/dynamicFlow/tests/StepModel.spec.js +119 -0
- package/build/legacy/dynamicFlow/tests/ValidationAsync.spec.js +484 -0
- package/build/legacy/dynamicFlow/tests/ssr.spec.js +47 -0
- package/build/legacy/dynamicFlow/utils/index.js +5 -0
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.js +185 -0
- package/build/legacy/dynamicFlow/utils/responseParsers/response-parsers.spec.js +463 -0
- package/build/legacy/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.js +35 -0
- package/build/legacy/dynamicFlow/utils/useDynamicFlowState.js +137 -0
- package/build/legacy/dynamicFlow/utils/useLoader.js +22 -0
- package/build/legacy/formControl/FormControl.js +265 -0
- package/build/legacy/formControl/Select.spec.js +104 -0
- package/build/legacy/formControl/index.js +1 -0
- package/build/legacy/formControl/utils/getAutocompleteString.js +80 -0
- package/build/legacy/formControl/utils/getAutocompleteString.spec.js +30 -0
- package/build/legacy/formControl/utils/index.js +2 -0
- package/build/legacy/formControl/utils/value-utils.js +108 -0
- package/build/legacy/formControl/utils/value-utils.spec.js +158 -0
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.end-to-end.spec.js +563 -0
- package/build/legacy/jsonSchemaForm/JsonSchemaForm.js +24 -0
- package/build/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.js +50 -0
- package/build/legacy/jsonSchemaForm/allOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.js +25 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.js +34 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.js +73 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.js +141 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/index.js +2 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/upload-utils.js +79 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.js +14 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.js +7 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.js +134 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.js +85 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.js +135 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/utils/summary-utils.spec.js +909 -0
- package/build/legacy/jsonSchemaForm/arrayTypeSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.js +100 -0
- package/build/legacy/jsonSchemaForm/basicTypeSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.js +89 -0
- package/build/legacy/jsonSchemaForm/controlFeedback/index.js +1 -0
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.js +85 -0
- package/build/legacy/jsonSchemaForm/genericSchema/GenericSchema.rtl.spec.js +55 -0
- package/build/legacy/jsonSchemaForm/genericSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/help/Help.js +9 -0
- package/build/legacy/jsonSchemaForm/help/index.js +1 -0
- package/build/legacy/jsonSchemaForm/index.js +1 -0
- package/build/legacy/jsonSchemaForm/objectSchema/ObjectSchema.js +77 -0
- package/build/legacy/jsonSchemaForm/objectSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.js +155 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/oneOfSchema/utils.js +68 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.js +26 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.js +165 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.js +131 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.js +31 -0
- package/build/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.js +72 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.js +8 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.js +16 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.js +31 -0
- package/build/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.js +32 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.js +54 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js +13 -0
- package/build/legacy/jsonSchemaForm/readOnlySchema/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.js +134 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.spec.js +312 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/index.js +1 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.js +107 -0
- package/build/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.spec.js +220 -0
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.js +150 -0
- package/build/legacy/jsonSchemaForm/validationAsyncSchema/index.js +1 -0
- package/build/legacy/layout/DynamicLayout.js +68 -0
- package/build/legacy/layout/alert/DynamicAlert.js +29 -0
- package/build/legacy/layout/box/DynamicBox.js +30 -0
- package/build/legacy/layout/button/DynamicButton.js +16 -0
- package/build/legacy/layout/button/DynamicButton.spec.js +141 -0
- package/build/legacy/layout/button/utils.js +45 -0
- package/build/legacy/layout/button/utils.spec.js +50 -0
- package/build/legacy/layout/columns/DynamicColumns.js +27 -0
- package/build/legacy/layout/decision/DynamicDecision.js +10 -0
- package/build/legacy/layout/divider/DynamicDivider.js +9 -0
- package/build/legacy/layout/external/DynamicExternal.js +32 -0
- package/build/legacy/layout/external/DynamicExternal.messages.js +8 -0
- package/build/legacy/layout/form/DynamicForm.js +22 -0
- package/build/legacy/layout/heading/DynamicHeading.js +40 -0
- package/build/legacy/layout/icon/DynamicIcon.js +17 -0
- package/build/legacy/layout/icon/DynamicIcon.spec.js +20 -0
- package/build/legacy/layout/icon/FlagIcon.js +11 -0
- package/build/legacy/layout/icon/NamedIcon.js +19 -0
- package/build/legacy/layout/image/DynamicImage.js +112 -0
- package/build/legacy/layout/index.js +20 -0
- package/build/legacy/layout/instructions/DynamicInstructions.js +19 -0
- package/build/legacy/layout/list/DynamicStatusList.js +37 -0
- package/build/legacy/layout/list/DynamicStatusList.spec.js +111 -0
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.js +11 -0
- package/build/legacy/layout/loadingIndicator/DynamicLoadingIndicator.spec.js +25 -0
- package/build/legacy/layout/markdown/DynamicMarkdown.js +12 -0
- package/build/legacy/layout/markdown/DynamicMarkdown.spec.js +58 -0
- package/build/legacy/layout/modal/DynamicModal.js +26 -0
- package/build/legacy/layout/paragraph/DynamicParagraph.js +35 -0
- package/build/legacy/layout/paragraph/useSnackBarIfAvailable.js +9 -0
- package/build/legacy/layout/review/DynamicReview.js +47 -0
- package/build/legacy/layout/review/DynamicReview.spec.js +152 -0
- package/build/legacy/layout/search/DynamicSearch.js +83 -0
- package/build/legacy/layout/search/SearchInput.js +6 -0
- package/build/legacy/layout/search/SearchResults.js +20 -0
- package/build/legacy/layout/search/useSearch.js +137 -0
- package/build/legacy/layout/utils/getNavigationOptionMedia.js +17 -0
- package/build/legacy/layout/utils/index.js +32 -0
- package/build/legacy/step/cameraStep/CameraStep.js +124 -0
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.js +161 -0
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.js +58 -0
- package/build/legacy/step/cameraStep/cameraCapture/CameraCapture.spec.js +432 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.js +17 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/index.js +3 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.js +8 -0
- package/build/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.js +8 -0
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.js +62 -0
- package/build/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.js +80 -0
- package/build/legacy/step/cameraStep/cameraCapture/index.js +1 -0
- package/build/legacy/step/cameraStep/cameraCapture/overlay/Overlay.js +77 -0
- package/build/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.js +7 -0
- package/build/legacy/step/cameraStep/cameraCapture/screens/index.js +1 -0
- package/build/legacy/step/cameraStep/cameraCapture/tracking/index.js +109 -0
- package/build/legacy/step/cameraStep/cameraCapture/types/index.js +7 -0
- package/build/legacy/step/cameraStep/cameraCapture/utils/index.js +107 -0
- package/build/legacy/step/cameraStep/index.js +1 -0
- package/build/legacy/step/externalConfirmationStep/ExternalConfirmationStep.js +64 -0
- package/build/legacy/step/externalConfirmationStep/index.js +1 -0
- package/build/legacy/step/index.js +3 -0
- package/build/legacy/step/layoutStep/LayoutStep.js +33 -0
- package/build/legacy/step/layoutStep/index.js +1 -0
- package/build/legacy/step/layoutStep/utils/index.js +2 -0
- package/build/legacy/step/layoutStep/utils/inline-reference-utils.js +105 -0
- package/build/legacy/step/layoutStep/utils/layout-utils.js +212 -0
- package/build/legacy/test-utils/DynamicFlowProviders.js +8 -0
- package/build/legacy/test-utils/index.js +4 -0
- package/build/legacy/test-utils/legacy-utils.js +69 -0
- package/build/legacy/test-utils/log-utils.js +9 -0
- package/build/main.js +47 -62
- package/build/main.min.js +1 -1
- package/build/main.mjs +35 -50
- package/build/revamp/DynamicFlowCore.js +26 -0
- package/build/revamp/DynamicFlowWise.js +32 -0
- package/build/revamp/DynamicFlowWise.spec.js +105 -0
- package/build/revamp/DynamicFragmentWise.js +83 -0
- package/build/revamp/domain/components/AlertComponent.js +50 -0
- package/build/revamp/domain/components/AllOfComponent.js +72 -0
- package/build/revamp/domain/components/BooleanInputComponent.js +109 -0
- package/build/revamp/domain/components/BoxComponent.js +65 -0
- package/build/revamp/domain/components/ButtonComponent.js +50 -0
- package/build/revamp/domain/components/ColumnsComponent.js +74 -0
- package/build/revamp/domain/components/ConstComponent.js +50 -0
- package/build/revamp/domain/components/ContainerComponent.js +65 -0
- package/build/revamp/domain/components/DateInputComponent.js +128 -0
- package/build/revamp/domain/components/DecisionComponent.js +50 -0
- package/build/revamp/domain/components/DividerComponent.js +50 -0
- package/build/revamp/domain/components/FormComponent.js +65 -0
- package/build/revamp/domain/components/HeadingComponent.js +50 -0
- package/build/revamp/domain/components/ImageComponent.js +50 -0
- package/build/revamp/domain/components/InstructionsComponent.js +50 -0
- package/build/revamp/domain/components/IntegerInputComponent.js +129 -0
- package/build/revamp/domain/components/LoadingIndicatorComponent.js +50 -0
- package/build/revamp/domain/components/MarkdownComponent.js +50 -0
- package/build/revamp/domain/components/ModalComponent.js +65 -0
- package/build/revamp/domain/components/MultiUploadInputComponent.js +192 -0
- package/build/revamp/domain/components/NumberInputComponent.js +129 -0
- package/build/revamp/domain/components/ObjectComponent.js +104 -0
- package/build/revamp/domain/components/ParagraphComponent.js +50 -0
- package/build/revamp/domain/components/ReviewComponent.js +50 -0
- package/build/revamp/domain/components/SelectInputComponent.js +140 -0
- package/build/revamp/domain/components/StatusListComponent.js +50 -0
- package/build/revamp/domain/components/StepDomainComponent.js +87 -0
- package/build/revamp/domain/components/TextInputComponent.js +129 -0
- package/build/revamp/domain/components/UploadInputComponent.js +154 -0
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.js +150 -0
- package/build/revamp/domain/components/repeatableComponent/RepeatableComponent.spec.js +146 -0
- package/build/revamp/domain/components/searchComponent/SearchComponent.js +111 -0
- package/build/revamp/domain/components/searchComponent/SearchComponent.spec.js +327 -0
- package/build/revamp/domain/components/utils/component-utils.js +18 -0
- package/build/revamp/domain/components/utils/debounce.js +38 -0
- package/build/revamp/domain/components/utils/debounce.spec.js +72 -0
- package/build/revamp/domain/components/utils/file-utils.js +46 -0
- package/build/revamp/domain/components/utils/getComponentForLocalValueKey.js +31 -0
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.js +53 -0
- package/build/revamp/domain/components/utils/isPartialLocalValueMatch.spec.js +108 -0
- package/build/revamp/domain/features/events.js +1 -0
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.js +133 -0
- package/build/revamp/domain/features/persistAsync/getComponentPersistAsync.spec.js +200 -0
- package/build/revamp/domain/features/persistAsync/getInitialPersistedState.js +6 -0
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.js +103 -0
- package/build/revamp/domain/features/persistAsync/getPerformPersistAsync.spec.js +280 -0
- package/build/revamp/domain/features/polling/getStepPolling.js +82 -0
- package/build/revamp/domain/features/polling/getStepPolling.spec.js +170 -0
- package/build/revamp/domain/features/refresh/getPerformRefresh.js +16 -0
- package/build/revamp/domain/features/search/getPerformSearchFunction.js +104 -0
- package/build/revamp/domain/features/search/getPerformSearchFunction.spec.js +260 -0
- package/build/revamp/domain/features/summary/summary-utils.js +39 -0
- package/build/revamp/domain/features/summary/summary-utils.spec.js +110 -0
- package/build/revamp/domain/features/utils/http-utils.js +34 -0
- package/build/revamp/domain/features/utils/response-utils.js +9 -0
- package/build/revamp/domain/features/validation/spec-utils.js +16 -0
- package/build/revamp/domain/features/validation/validation-functions.js +12 -0
- package/build/revamp/domain/features/validation/validation-functions.spec.js +110 -0
- package/build/revamp/domain/features/validation/value-checks.js +111 -0
- package/build/revamp/domain/features/validation/value-checks.spec.js +204 -0
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.js +95 -0
- package/build/revamp/domain/features/validationAsync/getComponentValidationAsync.spec.js +178 -0
- package/build/revamp/domain/features/validationAsync/getInitialValidationState.js +5 -0
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.js +107 -0
- package/build/revamp/domain/features/validationAsync/getPerformValidationAsync.spec.js +266 -0
- package/build/revamp/domain/mappers/layout/alertLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/boxLayoutToComponents.js +15 -0
- package/build/revamp/domain/mappers/layout/buttonLayoutToComponent.js +45 -0
- package/build/revamp/domain/mappers/layout/columnsLayoutToComponent.js +18 -0
- package/build/revamp/domain/mappers/layout/decisionLayoutToComponent.js +40 -0
- package/build/revamp/domain/mappers/layout/dividerLayoutToComponent.js +5 -0
- package/build/revamp/domain/mappers/layout/formLayoutToComponent.js +27 -0
- package/build/revamp/domain/mappers/layout/headingLayoutToComponent.js +13 -0
- package/build/revamp/domain/mappers/layout/imageLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/infoLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/instructionsLayoutToComponent.js +18 -0
- package/build/revamp/domain/mappers/layout/listLayoutToComponent.js +30 -0
- package/build/revamp/domain/mappers/layout/loadingIndicatorLayoutToComponent.js +5 -0
- package/build/revamp/domain/mappers/layout/markdownLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/modalLayoutToComponent.js +17 -0
- package/build/revamp/domain/mappers/layout/paragraphLayoutToComponent.js +12 -0
- package/build/revamp/domain/mappers/layout/reviewLayoutToComponent.js +51 -0
- package/build/revamp/domain/mappers/layout/searchLayoutToComponent.js +14 -0
- package/build/revamp/domain/mappers/layout/statusListLayoutToComponent.js +11 -0
- package/build/revamp/domain/mappers/mapLayoutToComponent.js +63 -0
- package/build/revamp/domain/mappers/mapSchemaToComponent.js +84 -0
- package/build/revamp/domain/mappers/mapSchemaToComponent.spec.js +197 -0
- package/build/revamp/domain/mappers/mapStepToComponent.js +159 -0
- package/build/revamp/domain/mappers/mapStepToComponent.spec.js +236 -0
- package/build/revamp/domain/mappers/schema/allOfSchemaToComponent.js +29 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.js +35 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.js +64 -0
- package/build/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.js +66 -0
- package/build/revamp/domain/mappers/schema/blobSchemaToComponent.js +30 -0
- package/build/revamp/domain/mappers/schema/booleanSchemaToComponent.js +38 -0
- package/build/revamp/domain/mappers/schema/constSchemaToComponent.js +14 -0
- package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +36 -0
- package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +35 -0
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.js +41 -0
- package/build/revamp/domain/mappers/schema/objectSchemaToComponent/objectSchemaToComponent.spec.js +165 -0
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.js +67 -0
- package/build/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.spec.js +316 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.js +14 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToComponent.spec.js +220 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.js +37 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +45 -0
- package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.js +32 -0
- package/build/revamp/domain/mappers/schema/tests/test-utils.js +27 -0
- package/build/revamp/domain/mappers/schema/types.js +1 -0
- package/build/revamp/domain/mappers/schema/utils/getPersistAsyncInitialState.js +35 -0
- package/build/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.js +25 -0
- package/build/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.js +28 -0
- package/build/revamp/domain/mappers/types.js +1 -0
- package/build/revamp/domain/mappers/utils/getAutocompleteString.js +76 -0
- package/build/revamp/domain/mappers/utils/getAutocompleteString.spec.js +21 -0
- package/build/revamp/domain/mappers/utils/getRandomId.js +2 -0
- package/build/revamp/domain/mappers/utils/inlineAction.js +23 -0
- package/build/revamp/domain/mappers/utils/legacy-utils.js +53 -0
- package/build/revamp/domain/types.js +1 -0
- package/build/revamp/flow/executeRefresh.js +97 -0
- package/build/revamp/flow/executeSubmission.js +160 -0
- package/build/revamp/flow/getResponseType.js +76 -0
- package/build/revamp/flow/response-utils.js +92 -0
- package/build/revamp/renderers/CoreContainerRenderer.js +8 -0
- package/build/revamp/renderers/getRenderFunction.js +55 -0
- package/build/revamp/renderers/getSchemaErrorMessageFunction.js +90 -0
- package/build/revamp/renderers/mappers/alertComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/allOfComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/booleanInputComponentToProps.js +16 -0
- package/build/revamp/renderers/mappers/boxComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/buttonComponentToProps.js +14 -0
- package/build/revamp/renderers/mappers/columnsComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/componentToRendererProps.js +105 -0
- package/build/revamp/renderers/mappers/containerComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/dateInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/decisionComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/dividerComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/formComponentToProps.js +4 -0
- package/build/revamp/renderers/mappers/headingComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/hiddenComponentToProps.js +3 -0
- package/build/revamp/renderers/mappers/imageComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/instructionsComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/integerInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/loadingIndicatorComponentToProps.js +9 -0
- package/build/revamp/renderers/mappers/markdownComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/modalComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/multiUploadInputComponentToProps.js +24 -0
- package/build/revamp/renderers/mappers/numberInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/objectComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/paragraphComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/repeatableComponentToProps.js +40 -0
- package/build/revamp/renderers/mappers/reviewComponentToProps.js +11 -0
- package/build/revamp/renderers/mappers/searchComponentToProps.js +53 -0
- package/build/revamp/renderers/mappers/selectInputComponentToProps.js +29 -0
- package/build/revamp/renderers/mappers/statusListComponentToProps.js +10 -0
- package/build/revamp/renderers/mappers/textInputComponentToProps.js +13 -0
- package/build/revamp/renderers/mappers/uploadInputComponentToProps.js +16 -0
- package/build/revamp/renderers/mappers/utils/inputComponentToProps.js +27 -0
- package/build/revamp/renderers/step/BackButton.js +11 -0
- package/build/revamp/renderers/step/ExternalConfirmationDialog.js +20 -0
- package/build/revamp/renderers/step/StepRenderer.js +30 -0
- package/build/revamp/renderers/step/StepRendererContext.js +11 -0
- package/build/revamp/renderers/step/useExternal.js +15 -0
- package/build/revamp/renderers/stepComponentToProps.js +11 -0
- package/build/revamp/renderers/types.js +1 -0
- package/build/revamp/stories/dev-tools/ActionResponse.story.js +101 -0
- package/build/revamp/stories/dev-tools/DynamicFlowRevamp.story.js +314 -0
- package/build/revamp/stories/dev-tools/EditableStep.story.js +71 -0
- package/build/revamp/stories/dev-tools/ErrorHandling.story.js +149 -0
- package/build/revamp/stories/dev-tools/External.story.js +83 -0
- package/build/revamp/stories/dev-tools/OneOf.Inititalisation.story.js +123 -0
- package/build/revamp/stories/dev-tools/PersistAsync.story.js +168 -0
- package/build/revamp/stories/dev-tools/Polling.story.js +79 -0
- package/build/revamp/stories/dev-tools/RefreshOnChange.story.js +309 -0
- package/build/revamp/stories/dev-tools/RefreshOnChange.with.PersistAsync.story.js +1004 -0
- package/build/revamp/stories/dev-tools/SearchFeature.story.js +260 -0
- package/build/revamp/stories/dev-tools/ServerTest.story.js +81 -0
- package/build/revamp/stories/dev-tools/Upload.story.js +221 -0
- package/build/revamp/stories/dev-tools/ValidationAsync.story.js +161 -0
- package/build/revamp/stories/examples/ObjectConst.story.js +153 -0
- package/build/revamp/stories/examples/OneOfInitialisation.story.js +102 -0
- package/build/revamp/stories/utils/fixtureHttpClient.js +130 -0
- package/build/revamp/stories/utils/mockSearchHandler.js +125 -0
- package/build/revamp/stories/visual-tests/VisualTests.story.js +111 -0
- package/build/revamp/test-utils/component-utils.js +19 -0
- package/build/revamp/test-utils/step-utils.js +6 -0
- package/build/revamp/tests/ImageRenderer.spec.js +108 -0
- package/build/revamp/tests/InitialAction.spec.js +299 -0
- package/build/revamp/tests/InitialStep.spec.js +104 -0
- package/build/revamp/tests/Logging.spec.js +112 -0
- package/build/revamp/tests/OneOfInitialisation.spec.js +754 -0
- package/build/revamp/tests/Polling.spec.js +611 -0
- package/build/revamp/tests/RefreshOnChange.ResponseHandling.spec.js +322 -0
- package/build/revamp/tests/RefreshOnChange.with.Tabs.spec.js +390 -0
- package/build/revamp/tests/RefreshOnChangePreserve.spec.js +218 -0
- package/build/revamp/tests/Rerendering.spec.js +156 -0
- package/build/revamp/tests/Submission.ResponseHandling.spec.js +697 -0
- package/build/revamp/tests/Submission.spec.js +399 -0
- package/build/revamp/tests/legacy/BackButton.spec.js +189 -0
- package/build/revamp/tests/legacy/HiddenSchemas.spec.js +312 -0
- package/build/revamp/tests/legacy/MultipleFileUploadSchema.spec.js +447 -0
- package/build/revamp/tests/legacy/PersistAsync.blob-schema.spec.js +339 -0
- package/build/revamp/tests/legacy/PersistAsync.string-schema.spec.js +385 -0
- package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +352 -0
- package/build/revamp/tests/legacy/RefreshStepOnChange.spec.js +623 -0
- package/build/revamp/tests/legacy/Search.spec.js +501 -0
- package/build/revamp/tests/legacy/ValidationAsync.spec.js +452 -0
- package/build/revamp/tests/legacy/useExternal.spec.js +235 -0
- package/build/revamp/types.js +1 -0
- package/build/revamp/useDynamicFlowCore.js +285 -0
- package/build/revamp/utils/component-utils.js +86 -0
- package/build/revamp/utils/component-utils.spec.js +385 -0
- package/build/revamp/utils/findComponent.js +29 -0
- package/build/revamp/utils/findComponent.spec.js +92 -0
- package/build/revamp/utils/type-utils.js +59 -0
- package/build/revamp/utils/type-validators.js +16 -0
- package/build/revamp/utils/type-validators.spec.js +163 -0
- package/build/revamp/utils/useStableCallback.js +21 -0
- package/build/revamp/wise/renderers/AlertRenderer.js +11 -0
- package/build/revamp/wise/renderers/BooleanInputRenderer.js +34 -0
- package/build/revamp/wise/renderers/BoxRenderer.js +19 -0
- package/build/revamp/wise/renderers/ButtonRenderer.js +53 -0
- package/build/revamp/wise/renderers/ColumnsRenderer.js +14 -0
- package/build/revamp/wise/renderers/DateInputRenderer.js +35 -0
- package/build/revamp/wise/renderers/DecisionRenderer.js +18 -0
- package/build/revamp/wise/renderers/DividerRenderer.js +10 -0
- package/build/revamp/wise/renderers/FormRenderer.js +10 -0
- package/build/revamp/wise/renderers/FormSectionRenderer.js +16 -0
- package/build/revamp/wise/renderers/HeadingRenderer.js +57 -0
- package/build/revamp/wise/renderers/ImageRenderer.js +112 -0
- package/build/revamp/wise/renderers/InstructionsRenderer.js +23 -0
- package/build/revamp/wise/renderers/IntegerInputRenderer.js +38 -0
- package/build/revamp/wise/renderers/LoadingIndicatorRenderer.js +11 -0
- package/build/revamp/wise/renderers/MarkdownRenderer.js +11 -0
- package/build/revamp/wise/renderers/ModalRenderer.js +25 -0
- package/build/revamp/wise/renderers/MultiUploadInputRenderer.js +63 -0
- package/build/revamp/wise/renderers/NumberInputRenderer.js +38 -0
- package/build/revamp/wise/renderers/ParagraphRenderer.js +45 -0
- package/build/revamp/wise/renderers/RepeatableRenderer.js +58 -0
- package/build/revamp/wise/renderers/ReviewRenderer.js +35 -0
- package/build/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.js +59 -0
- package/build/revamp/wise/renderers/SearchRenderer/ErrorResult.js +11 -0
- package/build/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.js +63 -0
- package/build/revamp/wise/renderers/SearchRenderer/SearchRenderer.js +21 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/OptionMedia.js +16 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.js +14 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.js +30 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.js +56 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.js +16 -0
- package/build/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.js +22 -0
- package/build/revamp/wise/renderers/StatusListRenderer.js +21 -0
- package/build/revamp/wise/renderers/TextInputRenderer.js +35 -0
- package/build/revamp/wise/renderers/UploadInputRenderer.js +136 -0
- package/build/revamp/wise/renderers/components/FieldInput.js +9 -0
- package/build/revamp/wise/renderers/components/Help.js +10 -0
- package/build/revamp/wise/renderers/components/LabelContentWithHelp.js +6 -0
- package/build/revamp/wise/renderers/components/UploadFieldInput.js +14 -0
- package/build/revamp/wise/renderers/components/VariableDateInput.js +30 -0
- package/build/revamp/wise/renderers/components/VariableTextInput.js +69 -0
- package/build/revamp/wise/renderers/components/icon/DynamicIcon.js +17 -0
- package/build/revamp/wise/renderers/components/icon/FlagIcon.js +11 -0
- package/build/revamp/wise/renderers/components/icon/NamedIcon.js +19 -0
- package/build/revamp/wise/renderers/components/icon/NavigationOptionMedia.js +20 -0
- package/build/revamp/wise/renderers/getWiseRenderers.js +57 -0
- package/build/revamp/wise/renderers/hooks/useSnackBarIfAvailable.js +6 -0
- package/build/revamp/wise/renderers/utils/file-utils.js +70 -0
- package/build/revamp/wise/renderers/utils/getRandomId.js +2 -0
- package/build/revamp/wise/renderers/utils/input-utils.js +6 -0
- package/build/revamp/wise/renderers/utils/layout-utils.js +31 -0
- package/build/revamp/wise/renderers/utils/value-utils.js +23 -0
- package/build/revamp/wise/renderers/utils/value-utils.spec.js +33 -0
- package/build/revamp/wise/renderers/validators/type-validators.js +15 -0
- package/build/test-utils/NeptuneProviders.js +23 -0
- package/build/test-utils/fetch-utils.js +104 -0
- package/build/test-utils/index.js +2 -0
- package/build/test-utils/rtl-utils.js +20 -0
- package/package.json +2 -2
package/build/main.mjs
CHANGED
|
@@ -1132,7 +1132,6 @@ var i18n_default = translations;
|
|
|
1132
1132
|
|
|
1133
1133
|
// src/revamp/DynamicFlowWise.tsx
|
|
1134
1134
|
import { useMemo as useMemo5 } from "react";
|
|
1135
|
-
import { useIntl as useIntl8 } from "react-intl";
|
|
1136
1135
|
|
|
1137
1136
|
// src/common/httpClientContext/HttpClientContext.tsx
|
|
1138
1137
|
import { createContext, useContext, useMemo } from "react";
|
|
@@ -12146,19 +12145,10 @@ import { jsx as jsx57 } from "react/jsx-runtime";
|
|
|
12146
12145
|
var wiseRenderers = getWiseRenderers();
|
|
12147
12146
|
function DynamicFlowWise(props) {
|
|
12148
12147
|
const { httpClient, renderers } = props;
|
|
12149
|
-
const { locale } = useIntl8();
|
|
12150
|
-
const wiseHttpClient = useMemo5(
|
|
12151
|
-
() => makeWiseHttpClient(httpClient, locale),
|
|
12152
|
-
[httpClient, locale]
|
|
12153
|
-
);
|
|
12154
12148
|
const mergedRenderers = useMemo5(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
12155
|
-
return /* @__PURE__ */ jsx57(HttpClientProvider, { httpClient
|
|
12149
|
+
return /* @__PURE__ */ jsx57(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx57(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
|
|
12156
12150
|
}
|
|
12157
12151
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
12158
|
-
var makeWiseHttpClient = (httpClient, locale) => async (input, init) => httpClient(
|
|
12159
|
-
input,
|
|
12160
|
-
mergeRequestInit(init, { credentials: "include", headers: { "accept-language": locale } })
|
|
12161
|
-
);
|
|
12162
12152
|
|
|
12163
12153
|
// src/revamp/DynamicFragmentWise.tsx
|
|
12164
12154
|
import { forwardRef as forwardRef3, useImperativeHandle, useMemo as useMemo6 } from "react";
|
|
@@ -12506,7 +12496,6 @@ function isReference(block) {
|
|
|
12506
12496
|
|
|
12507
12497
|
// src/legacy/dynamicFlow/DynamicFlow.tsx
|
|
12508
12498
|
import { useCallback as useCallback11, useEffect as useEffect25, useMemo as useMemo22, useState as useState34 } from "react";
|
|
12509
|
-
import { useIntl as useIntl25 } from "react-intl";
|
|
12510
12499
|
|
|
12511
12500
|
// src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
|
|
12512
12501
|
import { createContext as createContext4, useContext as useContext5, useMemo as useMemo7 } from "react";
|
|
@@ -13427,11 +13416,11 @@ function useExternalStepPolling(polling, onAction) {
|
|
|
13427
13416
|
|
|
13428
13417
|
// src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
|
|
13429
13418
|
import { useState as useState28 } from "react";
|
|
13430
|
-
import { useIntl as
|
|
13419
|
+
import { useIntl as useIntl19 } from "react-intl";
|
|
13431
13420
|
|
|
13432
13421
|
// src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
|
|
13433
13422
|
import { useEffect as useEffect17, useState as useState27 } from "react";
|
|
13434
|
-
import { useIntl as
|
|
13423
|
+
import { useIntl as useIntl18 } from "react-intl";
|
|
13435
13424
|
|
|
13436
13425
|
// src/legacy/common/constants/DateMode.ts
|
|
13437
13426
|
var DateMode = {
|
|
@@ -13827,7 +13816,7 @@ var DynamicDivider_default = DynamicDivider;
|
|
|
13827
13816
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
13828
13817
|
import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
|
|
13829
13818
|
import { useCallback as useCallback6, useEffect as useEffect7 } from "react";
|
|
13830
|
-
import { useIntl as
|
|
13819
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
13831
13820
|
|
|
13832
13821
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
13833
13822
|
import { defineMessages as defineMessages9 } from "react-intl";
|
|
@@ -13843,7 +13832,7 @@ var DynamicExternal_messages_default = defineMessages9({
|
|
|
13843
13832
|
import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
13844
13833
|
var DynamicExternal = ({ component, onAction }) => {
|
|
13845
13834
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
13846
|
-
const intl =
|
|
13835
|
+
const intl = useIntl8();
|
|
13847
13836
|
const openExternalUrl = useCallback6(
|
|
13848
13837
|
() => window.open(requestUrl, "df-external-window"),
|
|
13849
13838
|
[requestUrl]
|
|
@@ -13925,7 +13914,7 @@ import { useMemo as useMemo11, useState as useState13 } from "react";
|
|
|
13925
13914
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
13926
13915
|
import { InlineAlert as InlineAlert4 } from "@transferwise/components";
|
|
13927
13916
|
import { formatDate as formatDate3 } from "@transferwise/formatting";
|
|
13928
|
-
import { useIntl as
|
|
13917
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
13929
13918
|
import { jsx as jsx75, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
13930
13919
|
function ControlFeedback(props) {
|
|
13931
13920
|
var _a;
|
|
@@ -13951,7 +13940,7 @@ ControlFeedback.defaultProps = {
|
|
|
13951
13940
|
validationAsyncSuccessMessage: null
|
|
13952
13941
|
};
|
|
13953
13942
|
function useDefaultValidationMessages(schema) {
|
|
13954
|
-
const { formatMessage, locale } =
|
|
13943
|
+
const { formatMessage, locale } = useIntl9();
|
|
13955
13944
|
const formattedMessages = {
|
|
13956
13945
|
type: formatMessage(validation_messages_default.type),
|
|
13957
13946
|
minimum: formatMessage(validation_messages_default.minimum, {
|
|
@@ -14038,7 +14027,7 @@ function constructUploadError(response) {
|
|
|
14038
14027
|
}
|
|
14039
14028
|
|
|
14040
14029
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
|
|
14041
|
-
import { useIntl as
|
|
14030
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
14042
14031
|
|
|
14043
14032
|
// src/legacy/common/messages.ts
|
|
14044
14033
|
import { defineMessages as defineMessages10 } from "react-intl";
|
|
@@ -14055,7 +14044,7 @@ function useFormattedDefaultErrorMessages({
|
|
|
14055
14044
|
maxItems,
|
|
14056
14045
|
minItems
|
|
14057
14046
|
}) {
|
|
14058
|
-
const { formatMessage } =
|
|
14047
|
+
const { formatMessage } = useIntl10();
|
|
14059
14048
|
const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
|
|
14060
14049
|
return {
|
|
14061
14050
|
maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
|
|
@@ -14175,7 +14164,7 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
|
|
|
14175
14164
|
var import_classnames9 = __toESM(require_classnames());
|
|
14176
14165
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
14177
14166
|
import { useEffect as useEffect8, useMemo as useMemo12, useState as useState14 } from "react";
|
|
14178
|
-
import { useIntl as
|
|
14167
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
14179
14168
|
|
|
14180
14169
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
14181
14170
|
import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
|
|
@@ -14288,7 +14277,7 @@ function MultiSelectSchema({
|
|
|
14288
14277
|
errors,
|
|
14289
14278
|
onChange
|
|
14290
14279
|
}) {
|
|
14291
|
-
const { formatMessage, locale } =
|
|
14280
|
+
const { formatMessage, locale } = useIntl11();
|
|
14292
14281
|
const { disabled, items, validationMessages, placeholder } = schema;
|
|
14293
14282
|
const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
|
|
14294
14283
|
const id = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
@@ -14384,7 +14373,7 @@ var getInitialModelIndices = (model, options) => {
|
|
|
14384
14373
|
import { Header as Header7, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
|
|
14385
14374
|
import { Plus as Plus2 } from "@transferwise/icons";
|
|
14386
14375
|
import { useMemo as useMemo13, useState as useState16 } from "react";
|
|
14387
|
-
import { useIntl as
|
|
14376
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
14388
14377
|
|
|
14389
14378
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
|
|
14390
14379
|
import { NavigationOption as NavigationOption5 } from "@transferwise/components";
|
|
@@ -14404,7 +14393,7 @@ function ItemSummaryOption2({ item, onClick }) {
|
|
|
14404
14393
|
|
|
14405
14394
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
|
|
14406
14395
|
import { useState as useState15 } from "react";
|
|
14407
|
-
import { useIntl as
|
|
14396
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
14408
14397
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
14409
14398
|
function RepeatableSchemaStep({
|
|
14410
14399
|
type,
|
|
@@ -14415,7 +14404,7 @@ function RepeatableSchemaStep({
|
|
|
14415
14404
|
onModelChange,
|
|
14416
14405
|
onAction
|
|
14417
14406
|
}) {
|
|
14418
|
-
const { formatMessage } =
|
|
14407
|
+
const { formatMessage } = useIntl12();
|
|
14419
14408
|
const [filename, setFilename] = useState15(void 0);
|
|
14420
14409
|
const step = {
|
|
14421
14410
|
layout: [
|
|
@@ -14722,7 +14711,7 @@ function RepeatableSchema({
|
|
|
14722
14711
|
setEditableItem({ item: null, model: null });
|
|
14723
14712
|
setOpenModalType(null);
|
|
14724
14713
|
};
|
|
14725
|
-
const { formatMessage } =
|
|
14714
|
+
const { formatMessage } = useIntl13();
|
|
14726
14715
|
const validations = getValidationFailures(model, schema, required);
|
|
14727
14716
|
const base64ValidationMessages = useFormattedDefaultErrorMessages({
|
|
14728
14717
|
minItems: schema.minItems,
|
|
@@ -14938,10 +14927,10 @@ import { useEffect as useEffect11, useMemo as useMemo14, useState as useState18
|
|
|
14938
14927
|
|
|
14939
14928
|
// src/legacy/jsonSchemaForm/help/Help.tsx
|
|
14940
14929
|
import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
|
|
14941
|
-
import { useIntl as
|
|
14930
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
14942
14931
|
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
14943
14932
|
function Help2(props) {
|
|
14944
|
-
const intl =
|
|
14933
|
+
const intl = useIntl14();
|
|
14945
14934
|
return /* @__PURE__ */ jsx85(
|
|
14946
14935
|
Info2,
|
|
14947
14936
|
{
|
|
@@ -16184,7 +16173,7 @@ var PromotedOneOfSchema_default = PromotedOneOfSchema;
|
|
|
16184
16173
|
|
|
16185
16174
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
|
|
16186
16175
|
import { DefinitionList as DefinitionList2, Layout } from "@transferwise/components";
|
|
16187
|
-
import { useIntl as
|
|
16176
|
+
import { useIntl as useIntl15 } from "react-intl";
|
|
16188
16177
|
|
|
16189
16178
|
// src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
|
|
16190
16179
|
import { defineMessages as defineMessages12 } from "react-intl";
|
|
@@ -16205,7 +16194,7 @@ var ReadOnlySchema_messages_default = defineMessages12({
|
|
|
16205
16194
|
import { Fragment as Fragment17, jsx as jsx96, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
16206
16195
|
function ReadOnlySchema({ schema, model }) {
|
|
16207
16196
|
const { title = "" } = schema;
|
|
16208
|
-
const { formatMessage } =
|
|
16197
|
+
const { formatMessage } = useIntl15();
|
|
16209
16198
|
const value = getValueForSchema({ schema, model, formatMessage });
|
|
16210
16199
|
return /* @__PURE__ */ jsx96(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
|
|
16211
16200
|
}
|
|
@@ -16706,7 +16695,7 @@ var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
|
|
|
16706
16695
|
|
|
16707
16696
|
// src/legacy/layout/paragraph/DynamicParagraph.tsx
|
|
16708
16697
|
import { Button as Button8 } from "@transferwise/components";
|
|
16709
|
-
import { useIntl as
|
|
16698
|
+
import { useIntl as useIntl16 } from "react-intl";
|
|
16710
16699
|
|
|
16711
16700
|
// src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
|
|
16712
16701
|
import { SnackbarContext as SnackbarContext2 } from "@transferwise/components";
|
|
@@ -16731,7 +16720,7 @@ function BasicDynamicParagraph({ component }) {
|
|
|
16731
16720
|
] });
|
|
16732
16721
|
}
|
|
16733
16722
|
function CopyableDynamicParagraph({ component }) {
|
|
16734
|
-
const { formatMessage } =
|
|
16723
|
+
const { formatMessage } = useIntl16();
|
|
16735
16724
|
const createSnackbar = useSnackBarIfAvailable2();
|
|
16736
16725
|
const { text } = component;
|
|
16737
16726
|
const copy = () => {
|
|
@@ -16834,7 +16823,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
|
|
|
16834
16823
|
|
|
16835
16824
|
// src/legacy/layout/search/SearchResults.tsx
|
|
16836
16825
|
import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
16837
|
-
import { useIntl as
|
|
16826
|
+
import { useIntl as useIntl17 } from "react-intl";
|
|
16838
16827
|
import { jsx as jsx110, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
16839
16828
|
function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
16840
16829
|
if (results.length === 0) {
|
|
@@ -16854,7 +16843,7 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
|
|
|
16854
16843
|
)) });
|
|
16855
16844
|
}
|
|
16856
16845
|
function ErrorResult2({ onRetrySearch }) {
|
|
16857
|
-
const intl =
|
|
16846
|
+
const intl = useIntl17();
|
|
16858
16847
|
return /* @__PURE__ */ jsxs41("p", { className: "m-t-2", children: [
|
|
16859
16848
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
16860
16849
|
"\xA0",
|
|
@@ -17221,7 +17210,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
|
|
|
17221
17210
|
]);
|
|
17222
17211
|
function PersistAsyncBasicSchema(props) {
|
|
17223
17212
|
const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
|
|
17224
|
-
const intl =
|
|
17213
|
+
const intl = useIntl18();
|
|
17225
17214
|
const httpClient = useHttpClient();
|
|
17226
17215
|
const onEvent = useEventDispatcher();
|
|
17227
17216
|
const [persistAsyncModel, setPersistAsyncModel] = useState27(null);
|
|
@@ -17319,7 +17308,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
|
|
|
17319
17308
|
var usePersistAsync = (persistAsync) => {
|
|
17320
17309
|
const [abortController, setAbortController] = useState28(null);
|
|
17321
17310
|
const httpClient = useHttpClient();
|
|
17322
|
-
const intl =
|
|
17311
|
+
const intl = useIntl19();
|
|
17323
17312
|
const { schema } = persistAsync;
|
|
17324
17313
|
async function handlePersistAsync(model) {
|
|
17325
17314
|
const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
|
|
@@ -17550,7 +17539,7 @@ import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
|
17550
17539
|
|
|
17551
17540
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
|
|
17552
17541
|
import { useCallback as useCallback10, useEffect as useEffect23, useMemo as useMemo20, useRef as useRef8, useState as useState30 } from "react";
|
|
17553
|
-
import { useIntl as
|
|
17542
|
+
import { useIntl as useIntl22 } from "react-intl";
|
|
17554
17543
|
import Webcam from "react-webcam";
|
|
17555
17544
|
|
|
17556
17545
|
// src/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.ts
|
|
@@ -17615,14 +17604,14 @@ var CameraCapture_messages_default = defineMessages13({
|
|
|
17615
17604
|
|
|
17616
17605
|
// src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
|
|
17617
17606
|
import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
|
|
17618
|
-
import { useIntl as
|
|
17607
|
+
import { useIntl as useIntl20 } from "react-intl";
|
|
17619
17608
|
import { jsx as jsx116, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
17620
17609
|
var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx116("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx116(CaptureButton, { onClick: onCapture }) });
|
|
17621
17610
|
var ReviewBottomBar = ({
|
|
17622
17611
|
onSubmit,
|
|
17623
17612
|
onRetry
|
|
17624
17613
|
}) => {
|
|
17625
|
-
const intl =
|
|
17614
|
+
const intl = useIntl20();
|
|
17626
17615
|
return /* @__PURE__ */ jsx116("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx116("div", { className: "row", children: /* @__PURE__ */ jsxs45("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
|
|
17627
17616
|
/* @__PURE__ */ jsx116(
|
|
17628
17617
|
Button10,
|
|
@@ -17661,7 +17650,7 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx116(
|
|
|
17661
17650
|
);
|
|
17662
17651
|
|
|
17663
17652
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17664
|
-
import { useIntl as
|
|
17653
|
+
import { useIntl as useIntl21 } from "react-intl";
|
|
17665
17654
|
|
|
17666
17655
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
|
|
17667
17656
|
import { defineMessages as defineMessages14 } from "react-intl";
|
|
@@ -17676,7 +17665,7 @@ var OrientationLockOverlay_messages_default = defineMessages14({
|
|
|
17676
17665
|
// src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
|
|
17677
17666
|
import { jsx as jsx117, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
17678
17667
|
function OrientationLockOverlay() {
|
|
17679
|
-
const intl =
|
|
17668
|
+
const intl = useIntl21();
|
|
17680
17669
|
return /* @__PURE__ */ jsxs46("div", { className: "orientation-lock-overlay", children: [
|
|
17681
17670
|
/* @__PURE__ */ jsx117(
|
|
17682
17671
|
"img",
|
|
@@ -17963,7 +17952,7 @@ function CameraCapture({
|
|
|
17963
17952
|
shouldLockOrientation,
|
|
17964
17953
|
onEvent
|
|
17965
17954
|
);
|
|
17966
|
-
const intl =
|
|
17955
|
+
const intl = useIntl22();
|
|
17967
17956
|
const handleCapture = useCallback10(async () => {
|
|
17968
17957
|
var _a, _b, _c, _d, _e, _f;
|
|
17969
17958
|
if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
|
|
@@ -18186,12 +18175,12 @@ function getFirstAction(step) {
|
|
|
18186
18175
|
}
|
|
18187
18176
|
|
|
18188
18177
|
// src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
|
|
18189
|
-
import { useIntl as
|
|
18178
|
+
import { useIntl as useIntl23 } from "react-intl";
|
|
18190
18179
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
18191
18180
|
var noop6 = () => {
|
|
18192
18181
|
};
|
|
18193
18182
|
function ExternalConfirmationStep({ url, onClose }) {
|
|
18194
|
-
const { formatMessage } =
|
|
18183
|
+
const { formatMessage } = useIntl23();
|
|
18195
18184
|
return /* @__PURE__ */ jsx122(
|
|
18196
18185
|
DynamicLayout_default,
|
|
18197
18186
|
{
|
|
@@ -18580,7 +18569,6 @@ var DynamicFlowComponent = ({
|
|
|
18580
18569
|
onEvent = noop7,
|
|
18581
18570
|
onLog = noop7
|
|
18582
18571
|
}) => {
|
|
18583
|
-
const { locale } = useIntl25();
|
|
18584
18572
|
const {
|
|
18585
18573
|
formErrors,
|
|
18586
18574
|
globalError,
|
|
@@ -18632,15 +18620,12 @@ var DynamicFlowComponent = ({
|
|
|
18632
18620
|
return httpClient(url != null ? url : "", {
|
|
18633
18621
|
method,
|
|
18634
18622
|
headers: __spreadValues({
|
|
18635
|
-
"accept-language": locale,
|
|
18636
|
-
// FIXME move this out of the library https://transferwise.atlassian.net/browse/MC-3286
|
|
18637
18623
|
"Content-Type": "application/json"
|
|
18638
18624
|
}, etag2 ? { "If-None-Match": etag2 } : {}),
|
|
18639
|
-
credentials: "include",
|
|
18640
18625
|
body: method === "GET" ? void 0 : JSON.stringify(data)
|
|
18641
18626
|
});
|
|
18642
18627
|
},
|
|
18643
|
-
[httpClient
|
|
18628
|
+
[httpClient]
|
|
18644
18629
|
);
|
|
18645
18630
|
const performAction = async (action, data = {}) => {
|
|
18646
18631
|
cancelPendingRefreshes();
|
|
@@ -18697,7 +18682,7 @@ var DynamicFlowComponent = ({
|
|
|
18697
18682
|
if (initialStep) {
|
|
18698
18683
|
warnIfNoStepLayout(initialStep);
|
|
18699
18684
|
}
|
|
18700
|
-
}, [httpClient,
|
|
18685
|
+
}, [httpClient, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
|
|
18701
18686
|
const handleResponse = async (response, fetchType) => {
|
|
18702
18687
|
try {
|
|
18703
18688
|
if (response.status === 304) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { useMemo } from 'react';
|
|
12
|
+
import { CoreContainerRenderer } from './renderers/CoreContainerRenderer';
|
|
13
|
+
import { getRenderFunction } from './renderers/getRenderFunction';
|
|
14
|
+
import { StepRenderer } from './renderers/step/StepRenderer';
|
|
15
|
+
import { useDynamicFlowCore } from './useDynamicFlowCore';
|
|
16
|
+
import ErrorBoundary from '../common/errorBoundary/ErrorBoundary';
|
|
17
|
+
export function DynamicFlowCore(props) {
|
|
18
|
+
var stepComponentRef = useDynamicFlowCore(props).stepComponentRef;
|
|
19
|
+
var renderers = props.renderers, onEvent = props.onEvent, onError = props.onError;
|
|
20
|
+
var render = useMemo(function () { return getRenderFunction(__spreadArray(__spreadArray([CoreContainerRenderer], renderers, true), [StepRenderer], false)); }, [renderers]);
|
|
21
|
+
return (_jsx(ErrorBoundary, { onError: function (error) {
|
|
22
|
+
onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Failed', { error: error });
|
|
23
|
+
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
24
|
+
}, children: stepComponentRef.current ? render(stepComponentRef.current) : null // TODO: render loader instead?
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { useMemo } from 'react';
|
|
23
|
+
import { HttpClientProvider } from '../common/httpClientContext';
|
|
24
|
+
import { DynamicFlowCore } from './DynamicFlowCore';
|
|
25
|
+
import { getWiseRenderers } from './wise/renderers/getWiseRenderers';
|
|
26
|
+
var wiseRenderers = getWiseRenderers();
|
|
27
|
+
function DynamicFlowWise(props) {
|
|
28
|
+
var httpClient = props.httpClient, renderers = props.renderers;
|
|
29
|
+
var mergedRenderers = useMemo(function () { return __spreadArray(__spreadArray([], (renderers !== null && renderers !== void 0 ? renderers : []), true), wiseRenderers, true); }, [renderers]);
|
|
30
|
+
return (_jsx(HttpClientProvider, { httpClient: httpClient, children: _jsx(DynamicFlowCore, __assign({}, props, { renderers: mergedRenderers })) }));
|
|
31
|
+
}
|
|
32
|
+
export default DynamicFlowWise;
|
|
@@ -0,0 +1,105 @@
|
|
|
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 { screen } from '@testing-library/react';
|
|
14
|
+
import { getMockHttpClient, renderWithProviders } from '../test-utils';
|
|
15
|
+
import DynamicFlowWise from './DynamicFlowWise';
|
|
16
|
+
describe('DynamicFlow', function () {
|
|
17
|
+
var makeDefaultProps = function () { return ({
|
|
18
|
+
httpClient: getMockHttpClient({}),
|
|
19
|
+
onCompletion: jest.fn(),
|
|
20
|
+
onError: jest.fn(),
|
|
21
|
+
onEvent: jest.fn(),
|
|
22
|
+
onLog: jest.fn(),
|
|
23
|
+
}); };
|
|
24
|
+
beforeEach(function () {
|
|
25
|
+
jest.clearAllMocks();
|
|
26
|
+
});
|
|
27
|
+
describe('initial step', function () {
|
|
28
|
+
it('renders an initial step with title', function () {
|
|
29
|
+
var step = {
|
|
30
|
+
id: 'new-df-initial-step',
|
|
31
|
+
title: 'Dynamic Flow',
|
|
32
|
+
schemas: [],
|
|
33
|
+
layout: [
|
|
34
|
+
{ type: 'alert', markdown: 'This is an alert.', context: 'positive' },
|
|
35
|
+
{ type: 'paragraph', text: 'Please fill in the form below.', align: 'center' },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "new-df-flow-id" }, makeDefaultProps(), { initialStep: step })));
|
|
39
|
+
expect(screen.getByText('Dynamic Flow')).toBeInTheDocument();
|
|
40
|
+
expect(screen.getByText('This is an alert.')).toBeInTheDocument();
|
|
41
|
+
expect(screen.getByText('Please fill in the form below.')).toBeInTheDocument();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe('initial step with initial model', function () {
|
|
45
|
+
it('renders the step with relevant fields filled in', function () {
|
|
46
|
+
var step = {
|
|
47
|
+
id: 'new-df-initial-step',
|
|
48
|
+
title: 'Dynamic Flow',
|
|
49
|
+
schemas: [
|
|
50
|
+
{
|
|
51
|
+
$id: '#schema',
|
|
52
|
+
type: 'object',
|
|
53
|
+
title: 'Object schema title',
|
|
54
|
+
description: 'Object schema description',
|
|
55
|
+
displayOrder: ['name', 'occupation'],
|
|
56
|
+
properties: {
|
|
57
|
+
name: {
|
|
58
|
+
title: 'Full name',
|
|
59
|
+
type: 'string',
|
|
60
|
+
},
|
|
61
|
+
occupation: {
|
|
62
|
+
title: 'Occupation',
|
|
63
|
+
type: 'string',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
layout: [{ type: 'form', schemaId: '#schema' }],
|
|
69
|
+
model: { name: 'John Smith' },
|
|
70
|
+
};
|
|
71
|
+
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "new-df-flow-id" }, makeDefaultProps(), { initialStep: step })));
|
|
72
|
+
expect(screen.getByDisplayValue('John Smith')).toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe('Events', function () {
|
|
76
|
+
describe('when the flow starts with flowId and stepId', function () {
|
|
77
|
+
it('emits a flow started event containing those values', function () {
|
|
78
|
+
var props = __assign(__assign({}, makeDefaultProps()), { initialStep: {
|
|
79
|
+
id: 'ny-initial-step-id',
|
|
80
|
+
title: 'Dynamic Flow',
|
|
81
|
+
schemas: [],
|
|
82
|
+
layout: [],
|
|
83
|
+
} });
|
|
84
|
+
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "my-flow-id" }, props)));
|
|
85
|
+
expect(props.onEvent).toHaveBeenCalledWith('Dynamic Flow - Initiated', expect.objectContaining({
|
|
86
|
+
flowId: 'my-flow-id',
|
|
87
|
+
stepId: 'ny-initial-step-id',
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
it('emits a step shown event containing those values', function () {
|
|
91
|
+
var props = __assign(__assign({}, makeDefaultProps()), { initialStep: {
|
|
92
|
+
id: 'ny-initial-step-id',
|
|
93
|
+
title: 'Dynamic Flow',
|
|
94
|
+
schemas: [],
|
|
95
|
+
layout: [],
|
|
96
|
+
} });
|
|
97
|
+
renderWithProviders(_jsx(DynamicFlowWise, __assign({ flowId: "my-flow-id" }, props)));
|
|
98
|
+
expect(props.onEvent).toHaveBeenCalledWith('Dynamic Flow - Step Shown', expect.objectContaining({
|
|
99
|
+
flowId: 'my-flow-id',
|
|
100
|
+
stepId: 'ny-initial-step-id',
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
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;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
46
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
47
|
+
import { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
48
|
+
import ErrorBoundary from '../common/errorBoundary/ErrorBoundary';
|
|
49
|
+
import { HttpClientProvider } from '../common/httpClientContext';
|
|
50
|
+
import { CoreContainerRenderer } from './renderers/CoreContainerRenderer';
|
|
51
|
+
import { getRenderFunction } from './renderers/getRenderFunction';
|
|
52
|
+
import { StepRenderer } from './renderers/step/StepRenderer';
|
|
53
|
+
import { useDynamicFlowCore } from './useDynamicFlowCore';
|
|
54
|
+
import { getWiseRenderers } from './wise/renderers/getWiseRenderers';
|
|
55
|
+
var wiseRenderers = getWiseRenderers();
|
|
56
|
+
/**
|
|
57
|
+
* DynamicFragmentWise is like DynamicFlowWise, but it also accepts a ForwardedRef.
|
|
58
|
+
* This ref conforms to the DynamicFragmentController type, containing two functions: `getValue` and `validate`.
|
|
59
|
+
* @experimental This component may be changed in the future without notice.
|
|
60
|
+
*/
|
|
61
|
+
var DynamicFragmentWise = forwardRef(function DynamicFragmentWise(props, ref) {
|
|
62
|
+
var _this = this;
|
|
63
|
+
var httpClient = props.httpClient, onEvent = props.onEvent, onError = props.onError, renderers = props.renderers;
|
|
64
|
+
var mergedRenderers = useMemo(function () { return __spreadArray(__spreadArray([], (renderers !== null && renderers !== void 0 ? renderers : []), true), wiseRenderers, true); }, [renderers]);
|
|
65
|
+
var stepComponentRef = useDynamicFlowCore(props).stepComponentRef;
|
|
66
|
+
useImperativeHandle(ref, function () { return ({
|
|
67
|
+
getValue: function () { return __awaiter(_this, void 0, void 0, function () { var _a, _b; return __generator(this, function (_c) {
|
|
68
|
+
switch (_c.label) {
|
|
69
|
+
case 0: return [4 /*yield*/, ((_a = stepComponentRef.current) === null || _a === void 0 ? void 0 : _a.getSubmittableValue())];
|
|
70
|
+
case 1: return [2 /*return*/, (_b = (_c.sent())) !== null && _b !== void 0 ? _b : null];
|
|
71
|
+
}
|
|
72
|
+
}); }); },
|
|
73
|
+
validate: function () { var _a, _b; return (_b = (_a = stepComponentRef.current) === null || _a === void 0 ? void 0 : _a.validate()) !== null && _b !== void 0 ? _b : false; },
|
|
74
|
+
}); },
|
|
75
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
|
+
[]);
|
|
77
|
+
var render = useMemo(function () { return getRenderFunction(__spreadArray(__spreadArray([CoreContainerRenderer], mergedRenderers, true), [StepRenderer], false)); }, [mergedRenderers]);
|
|
78
|
+
return (_jsx(ErrorBoundary, { onError: function (error) {
|
|
79
|
+
onEvent === null || onEvent === void 0 ? void 0 : onEvent('Dynamic Flow - Failed');
|
|
80
|
+
onError(error);
|
|
81
|
+
}, children: _jsx(HttpClientProvider, { httpClient: httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null }) }));
|
|
82
|
+
});
|
|
83
|
+
export default DynamicFragmentWise;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
export var createAlertComponent = function (alertProps) { return (__assign(__assign({ type: 'alert' }, alertProps), { getSubmittableValue: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
49
|
+
return [2 /*return*/, null];
|
|
50
|
+
}); }); }, getLocalValue: function () { return null; }, getSummary: function () { return ({}); }, validate: function () { return true; } })); };
|