@veridid/workflow-ui 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +217 -2
- package/build/module/WorkflowFontScaleContext.js +67 -0
- package/build/module/WorkflowFontScaleContext.js.map +1 -0
- package/build/module/adapter/WalletAdapter.js +152 -0
- package/build/module/adapter/WalletAdapter.js.map +1 -0
- package/build/module/components/FallbackVideoPlayer.js +8 -0
- package/build/module/components/FallbackVideoPlayer.js.map +1 -0
- package/build/module/components/FallbackVideoPlayer.native.js +10 -0
- package/build/module/components/FallbackVideoPlayer.native.js.map +1 -0
- package/build/module/components/FallbackVideoPlayer.web.js +35 -0
- package/build/module/components/FallbackVideoPlayer.web.js.map +1 -0
- package/build/module/components/WorkflowButtonLabel.js +32 -0
- package/build/module/components/WorkflowButtonLabel.js.map +1 -0
- package/build/module/components/WorkflowCalendarIcon.js +73 -0
- package/build/module/components/WorkflowCalendarIcon.js.map +1 -0
- package/build/module/components/WorkflowText.js +92 -0
- package/build/module/components/WorkflowText.js.map +1 -0
- package/build/module/content/BadgeContent.js +73 -0
- package/build/module/content/BadgeContent.js.map +1 -0
- package/build/module/content/BarChartContent.js +97 -0
- package/build/module/content/BarChartContent.js.map +1 -0
- package/build/module/content/BarcodeContent.js +78 -0
- package/build/module/content/BarcodeContent.js.map +1 -0
- package/build/module/content/BasicTableContent.js +145 -0
- package/build/module/content/BasicTableContent.js.map +1 -0
- package/build/module/content/ButtonContent.js +130 -0
- package/build/module/content/ButtonContent.js.map +1 -0
- package/build/module/content/CalendarContent.js +173 -0
- package/build/module/content/CalendarContent.js.map +1 -0
- package/build/module/content/CardContent.js +114 -0
- package/build/module/content/CardContent.js.map +1 -0
- package/build/module/content/CarouselContent.js +173 -0
- package/build/module/content/CarouselContent.js.map +1 -0
- package/build/module/content/ChipContent.js +214 -0
- package/build/module/content/ChipContent.js.map +1 -0
- package/build/module/content/ChipRowContent.js +127 -0
- package/build/module/content/ChipRowContent.js.map +1 -0
- package/build/module/content/CredentialOfferContent.js +312 -0
- package/build/module/content/CredentialOfferContent.js.map +1 -0
- package/build/module/content/DialContent.js +101 -0
- package/build/module/content/DialContent.js.map +1 -0
- package/build/module/content/DividerContent.js +26 -0
- package/build/module/content/DividerContent.js.map +1 -0
- package/build/module/content/DonutChartContent.js +118 -0
- package/build/module/content/DonutChartContent.js.map +1 -0
- package/build/module/content/FormContent.js +141 -0
- package/build/module/content/FormContent.js.map +1 -0
- package/build/module/content/FormFieldBridge.js +157 -0
- package/build/module/content/FormFieldBridge.js.map +1 -0
- package/build/module/content/GaugeContent.js +77 -0
- package/build/module/content/GaugeContent.js.map +1 -0
- package/build/module/content/GridLayoutContent.js +227 -0
- package/build/module/content/GridLayoutContent.js.map +1 -0
- package/build/module/content/ImageContent.js +190 -0
- package/build/module/content/ImageContent.js.map +1 -0
- package/build/module/content/ListContent.js +121 -0
- package/build/module/content/ListContent.js.map +1 -0
- package/build/module/content/LocationContent.js +148 -0
- package/build/module/content/LocationContent.js.map +1 -0
- package/build/module/content/MapContent.js +213 -0
- package/build/module/content/MapContent.js.map +1 -0
- package/build/module/content/MultipleChoiceContent.js +91 -0
- package/build/module/content/MultipleChoiceContent.js.map +1 -0
- package/build/module/content/OpenBadgePreviewContent.js +141 -0
- package/build/module/content/OpenBadgePreviewContent.js.map +1 -0
- package/build/module/content/PhotoContent.js +154 -0
- package/build/module/content/PhotoContent.js.map +1 -0
- package/build/module/content/PieChartContent.js +129 -0
- package/build/module/content/PieChartContent.js.map +1 -0
- package/build/module/content/ProofPresentationContent.js +154 -0
- package/build/module/content/ProofPresentationContent.js.map +1 -0
- package/build/module/content/RadioButtonContent.js +136 -0
- package/build/module/content/RadioButtonContent.js.map +1 -0
- package/build/module/content/RowContent.js +539 -0
- package/build/module/content/RowContent.js.map +1 -0
- package/build/module/content/SectionContent.js +123 -0
- package/build/module/content/SectionContent.js.map +1 -0
- package/build/module/content/ShareEntryContent.js +111 -0
- package/build/module/content/ShareEntryContent.js.map +1 -0
- package/build/module/content/SimulatedHint.js +33 -0
- package/build/module/content/SimulatedHint.js.map +1 -0
- package/build/module/content/SliderContent.js +46 -0
- package/build/module/content/SliderContent.js.map +1 -0
- package/build/module/content/SpacerContent.js +21 -0
- package/build/module/content/SpacerContent.js.map +1 -0
- package/build/module/content/SpinnerContent.js +33 -0
- package/build/module/content/SpinnerContent.js.map +1 -0
- package/build/module/content/SubmitButtonContent.js +281 -0
- package/build/module/content/SubmitButtonContent.js.map +1 -0
- package/build/module/content/TextContent.js +127 -0
- package/build/module/content/TextContent.js.map +1 -0
- package/build/module/content/TileContent.js +237 -0
- package/build/module/content/TileContent.js.map +1 -0
- package/build/module/content/TimelineContent.js +120 -0
- package/build/module/content/TimelineContent.js.map +1 -0
- package/build/module/content/TitleContent.js +55 -0
- package/build/module/content/TitleContent.js.map +1 -0
- package/build/module/content/VideoContent.js +142 -0
- package/build/module/content/VideoContent.js.map +1 -0
- package/build/module/content/WebLinkContent.js +95 -0
- package/build/module/content/WebLinkContent.js.map +1 -0
- package/build/module/content/index.js +48 -0
- package/build/module/content/index.js.map +1 -0
- package/build/module/form-fields/CheckboxField.js +47 -0
- package/build/module/form-fields/CheckboxField.js.map +1 -0
- package/build/module/form-fields/DateField.js +8 -0
- package/build/module/form-fields/DateField.js.map +1 -0
- package/build/module/form-fields/DateField.native.js +141 -0
- package/build/module/form-fields/DateField.native.js.map +1 -0
- package/build/module/form-fields/DateField.web.js +45 -0
- package/build/module/form-fields/DateField.web.js.map +1 -0
- package/build/module/form-fields/DropdownField.js +172 -0
- package/build/module/form-fields/DropdownField.js.map +1 -0
- package/build/module/form-fields/MCQField.js +100 -0
- package/build/module/form-fields/MCQField.js.map +1 -0
- package/build/module/form-fields/RadioField.js +56 -0
- package/build/module/form-fields/RadioField.js.map +1 -0
- package/build/module/form-fields/SliderField.js +8 -0
- package/build/module/form-fields/SliderField.js.map +1 -0
- package/build/module/form-fields/SliderField.native.js +77 -0
- package/build/module/form-fields/SliderField.native.js.map +1 -0
- package/build/module/form-fields/SliderField.web.js +82 -0
- package/build/module/form-fields/SliderField.web.js.map +1 -0
- package/build/module/form-fields/SubmitButtonField.js +42 -0
- package/build/module/form-fields/SubmitButtonField.js.map +1 -0
- package/build/module/form-fields/TextField.js +56 -0
- package/build/module/form-fields/TextField.js.map +1 -0
- package/build/module/form-fields/index.js +15 -0
- package/build/module/form-fields/index.js.map +1 -0
- package/build/module/i18n/WorkflowI18n.js +94 -0
- package/build/module/i18n/WorkflowI18n.js.map +1 -0
- package/build/module/icons/VectorIcon.js +23 -0
- package/build/module/icons/VectorIcon.js.map +1 -0
- package/build/module/icons/VectorIcon.web.js +62 -0
- package/build/module/icons/VectorIcon.web.js.map +1 -0
- package/build/module/icons/WorkflowIcon.js +36 -0
- package/build/module/icons/WorkflowIcon.js.map +1 -0
- package/build/module/icons/types.js +4 -0
- package/build/module/icons/types.js.map +1 -0
- package/build/module/imageUriCache.js +25 -0
- package/build/module/imageUriCache.js.map +1 -0
- package/build/module/index.js +50 -0
- package/build/module/index.js.map +1 -0
- package/build/module/modal/WorkflowModal.js +115 -0
- package/build/module/modal/WorkflowModal.js.map +1 -0
- package/build/module/package.json +1 -0
- package/build/module/platform/platformName.js +10 -0
- package/build/module/platform/platformName.js.map +1 -0
- package/build/module/platform/platformName.web.js +5 -0
- package/build/module/platform/platformName.web.js.map +1 -0
- package/build/module/protocol/controlSnapshotStore.js +19 -0
- package/build/module/protocol/controlSnapshotStore.js.map +1 -0
- package/build/module/protocol/useProtocolExchange.js +168 -0
- package/build/module/protocol/useProtocolExchange.js.map +1 -0
- package/build/module/registries/ContentRegistry.js +53 -0
- package/build/module/registries/ContentRegistry.js.map +1 -0
- package/build/module/registries/FormFieldRegistry.js +56 -0
- package/build/module/registries/FormFieldRegistry.js.map +1 -0
- package/build/module/render/NodeBoundary.js +73 -0
- package/build/module/render/NodeBoundary.js.map +1 -0
- package/build/module/render/RenderTree.js +52 -0
- package/build/module/render/RenderTree.js.map +1 -0
- package/build/module/render/WorkflowRenderContext.js +34 -0
- package/build/module/render/WorkflowRenderContext.js.map +1 -0
- package/build/module/render/nodes.js +103 -0
- package/build/module/render/nodes.js.map +1 -0
- package/build/module/responsive/ResponsiveProvider.js +63 -0
- package/build/module/responsive/ResponsiveProvider.js.map +1 -0
- package/build/module/responsive/index.js +4 -0
- package/build/module/responsive/index.js.map +1 -0
- package/build/module/responsive/responsive.js +56 -0
- package/build/module/responsive/responsive.js.map +1 -0
- package/build/module/style/resolveDisplayHintStyle.js +145 -0
- package/build/module/style/resolveDisplayHintStyle.js.map +1 -0
- package/build/module/theme/WorkflowTheme.js +200 -0
- package/build/module/theme/WorkflowTheme.js.map +1 -0
- package/build/module/utils/testable.js +12 -0
- package/build/module/utils/testable.js.map +1 -0
- package/build/typescript/WorkflowFontScaleContext.d.ts +7 -0
- package/build/typescript/WorkflowFontScaleContext.d.ts.map +1 -0
- package/build/typescript/adapter/WalletAdapter.d.ts +145 -0
- package/build/typescript/adapter/WalletAdapter.d.ts.map +1 -0
- package/build/typescript/components/FallbackVideoPlayer.d.ts +6 -0
- package/build/typescript/components/FallbackVideoPlayer.d.ts.map +1 -0
- package/build/typescript/components/FallbackVideoPlayer.native.d.ts +7 -0
- package/build/typescript/components/FallbackVideoPlayer.native.d.ts.map +1 -0
- package/build/typescript/components/FallbackVideoPlayer.web.d.ts +9 -0
- package/build/typescript/components/FallbackVideoPlayer.web.d.ts.map +1 -0
- package/build/typescript/components/WorkflowButtonLabel.d.ts +11 -0
- package/build/typescript/components/WorkflowButtonLabel.d.ts.map +1 -0
- package/build/typescript/components/WorkflowCalendarIcon.d.ts +11 -0
- package/build/typescript/components/WorkflowCalendarIcon.d.ts.map +1 -0
- package/build/typescript/components/WorkflowText.d.ts +13 -0
- package/build/typescript/components/WorkflowText.d.ts.map +1 -0
- package/build/typescript/content/BadgeContent.d.ts +5 -0
- package/build/typescript/content/BadgeContent.d.ts.map +1 -0
- package/build/typescript/content/BarChartContent.d.ts +5 -0
- package/build/typescript/content/BarChartContent.d.ts.map +1 -0
- package/build/typescript/content/BarcodeContent.d.ts +11 -0
- package/build/typescript/content/BarcodeContent.d.ts.map +1 -0
- package/build/typescript/content/BasicTableContent.d.ts +5 -0
- package/build/typescript/content/BasicTableContent.d.ts.map +1 -0
- package/build/typescript/content/ButtonContent.d.ts +5 -0
- package/build/typescript/content/ButtonContent.d.ts.map +1 -0
- package/build/typescript/content/CalendarContent.d.ts +19 -0
- package/build/typescript/content/CalendarContent.d.ts.map +1 -0
- package/build/typescript/content/CardContent.d.ts +5 -0
- package/build/typescript/content/CardContent.d.ts.map +1 -0
- package/build/typescript/content/CarouselContent.d.ts +5 -0
- package/build/typescript/content/CarouselContent.d.ts.map +1 -0
- package/build/typescript/content/ChipContent.d.ts +5 -0
- package/build/typescript/content/ChipContent.d.ts.map +1 -0
- package/build/typescript/content/ChipRowContent.d.ts +8 -0
- package/build/typescript/content/ChipRowContent.d.ts.map +1 -0
- package/build/typescript/content/CredentialOfferContent.d.ts +98 -0
- package/build/typescript/content/CredentialOfferContent.d.ts.map +1 -0
- package/build/typescript/content/DialContent.d.ts +5 -0
- package/build/typescript/content/DialContent.d.ts.map +1 -0
- package/build/typescript/content/DividerContent.d.ts +5 -0
- package/build/typescript/content/DividerContent.d.ts.map +1 -0
- package/build/typescript/content/DonutChartContent.d.ts +5 -0
- package/build/typescript/content/DonutChartContent.d.ts.map +1 -0
- package/build/typescript/content/FormContent.d.ts +19 -0
- package/build/typescript/content/FormContent.d.ts.map +1 -0
- package/build/typescript/content/FormFieldBridge.d.ts +2 -0
- package/build/typescript/content/FormFieldBridge.d.ts.map +1 -0
- package/build/typescript/content/GaugeContent.d.ts +5 -0
- package/build/typescript/content/GaugeContent.d.ts.map +1 -0
- package/build/typescript/content/GridLayoutContent.d.ts +5 -0
- package/build/typescript/content/GridLayoutContent.d.ts.map +1 -0
- package/build/typescript/content/ImageContent.d.ts +5 -0
- package/build/typescript/content/ImageContent.d.ts.map +1 -0
- package/build/typescript/content/ListContent.d.ts +5 -0
- package/build/typescript/content/ListContent.d.ts.map +1 -0
- package/build/typescript/content/LocationContent.d.ts +32 -0
- package/build/typescript/content/LocationContent.d.ts.map +1 -0
- package/build/typescript/content/MapContent.d.ts +11 -0
- package/build/typescript/content/MapContent.d.ts.map +1 -0
- package/build/typescript/content/MultipleChoiceContent.d.ts +5 -0
- package/build/typescript/content/MultipleChoiceContent.d.ts.map +1 -0
- package/build/typescript/content/OpenBadgePreviewContent.d.ts +14 -0
- package/build/typescript/content/OpenBadgePreviewContent.d.ts.map +1 -0
- package/build/typescript/content/PhotoContent.d.ts +57 -0
- package/build/typescript/content/PhotoContent.d.ts.map +1 -0
- package/build/typescript/content/PieChartContent.d.ts +5 -0
- package/build/typescript/content/PieChartContent.d.ts.map +1 -0
- package/build/typescript/content/ProofPresentationContent.d.ts +14 -0
- package/build/typescript/content/ProofPresentationContent.d.ts.map +1 -0
- package/build/typescript/content/RadioButtonContent.d.ts +5 -0
- package/build/typescript/content/RadioButtonContent.d.ts.map +1 -0
- package/build/typescript/content/RowContent.d.ts +5 -0
- package/build/typescript/content/RowContent.d.ts.map +1 -0
- package/build/typescript/content/SectionContent.d.ts +5 -0
- package/build/typescript/content/SectionContent.d.ts.map +1 -0
- package/build/typescript/content/ShareEntryContent.d.ts +15 -0
- package/build/typescript/content/ShareEntryContent.d.ts.map +1 -0
- package/build/typescript/content/SimulatedHint.d.ts +9 -0
- package/build/typescript/content/SimulatedHint.d.ts.map +1 -0
- package/build/typescript/content/SliderContent.d.ts +10 -0
- package/build/typescript/content/SliderContent.d.ts.map +1 -0
- package/build/typescript/content/SpacerContent.d.ts +5 -0
- package/build/typescript/content/SpacerContent.d.ts.map +1 -0
- package/build/typescript/content/SpinnerContent.d.ts +5 -0
- package/build/typescript/content/SpinnerContent.d.ts.map +1 -0
- package/build/typescript/content/SubmitButtonContent.d.ts +9 -0
- package/build/typescript/content/SubmitButtonContent.d.ts.map +1 -0
- package/build/typescript/content/TextContent.d.ts +5 -0
- package/build/typescript/content/TextContent.d.ts.map +1 -0
- package/build/typescript/content/TileContent.d.ts +5 -0
- package/build/typescript/content/TileContent.d.ts.map +1 -0
- package/build/typescript/content/TimelineContent.d.ts +5 -0
- package/build/typescript/content/TimelineContent.d.ts.map +1 -0
- package/build/typescript/content/TitleContent.d.ts +5 -0
- package/build/typescript/content/TitleContent.d.ts.map +1 -0
- package/build/typescript/content/VideoContent.d.ts +10 -0
- package/build/typescript/content/VideoContent.d.ts.map +1 -0
- package/build/typescript/content/WebLinkContent.d.ts +5 -0
- package/build/typescript/content/WebLinkContent.d.ts.map +1 -0
- package/build/typescript/content/index.d.ts +46 -0
- package/build/typescript/content/index.d.ts.map +1 -0
- package/build/typescript/form-fields/CheckboxField.d.ts +5 -0
- package/build/typescript/form-fields/CheckboxField.d.ts.map +1 -0
- package/build/typescript/form-fields/DateField.d.ts +6 -0
- package/build/typescript/form-fields/DateField.d.ts.map +1 -0
- package/build/typescript/form-fields/DateField.native.d.ts +5 -0
- package/build/typescript/form-fields/DateField.native.d.ts.map +1 -0
- package/build/typescript/form-fields/DateField.web.d.ts +9 -0
- package/build/typescript/form-fields/DateField.web.d.ts.map +1 -0
- package/build/typescript/form-fields/DropdownField.d.ts +5 -0
- package/build/typescript/form-fields/DropdownField.d.ts.map +1 -0
- package/build/typescript/form-fields/MCQField.d.ts +5 -0
- package/build/typescript/form-fields/MCQField.d.ts.map +1 -0
- package/build/typescript/form-fields/RadioField.d.ts +5 -0
- package/build/typescript/form-fields/RadioField.d.ts.map +1 -0
- package/build/typescript/form-fields/SliderField.d.ts +6 -0
- package/build/typescript/form-fields/SliderField.d.ts.map +1 -0
- package/build/typescript/form-fields/SliderField.native.d.ts +5 -0
- package/build/typescript/form-fields/SliderField.native.d.ts.map +1 -0
- package/build/typescript/form-fields/SliderField.web.d.ts +11 -0
- package/build/typescript/form-fields/SliderField.web.d.ts.map +1 -0
- package/build/typescript/form-fields/SubmitButtonField.d.ts +5 -0
- package/build/typescript/form-fields/SubmitButtonField.d.ts.map +1 -0
- package/build/typescript/form-fields/TextField.d.ts +5 -0
- package/build/typescript/form-fields/TextField.d.ts.map +1 -0
- package/build/typescript/form-fields/index.d.ts +13 -0
- package/build/typescript/form-fields/index.d.ts.map +1 -0
- package/build/typescript/i18n/WorkflowI18n.d.ts +75 -0
- package/build/typescript/i18n/WorkflowI18n.d.ts.map +1 -0
- package/build/typescript/icons/VectorIcon.d.ts +4 -0
- package/build/typescript/icons/VectorIcon.d.ts.map +1 -0
- package/build/typescript/icons/VectorIcon.web.d.ts +16 -0
- package/build/typescript/icons/VectorIcon.web.d.ts.map +1 -0
- package/build/typescript/icons/WorkflowIcon.d.ts +19 -0
- package/build/typescript/icons/WorkflowIcon.d.ts.map +1 -0
- package/build/typescript/icons/types.d.ts +12 -0
- package/build/typescript/icons/types.d.ts.map +1 -0
- package/build/typescript/imageUriCache.d.ts +7 -0
- package/build/typescript/imageUriCache.d.ts.map +1 -0
- package/build/typescript/index.d.ts +48 -0
- package/build/typescript/index.d.ts.map +1 -0
- package/build/typescript/modal/WorkflowModal.d.ts +33 -0
- package/build/typescript/modal/WorkflowModal.d.ts.map +1 -0
- package/build/typescript/package.json +1 -0
- package/build/typescript/platform/platformName.d.ts +8 -0
- package/build/typescript/platform/platformName.d.ts.map +1 -0
- package/build/typescript/platform/platformName.web.d.ts +3 -0
- package/build/typescript/platform/platformName.web.d.ts.map +1 -0
- package/build/typescript/protocol/controlSnapshotStore.d.ts +12 -0
- package/build/typescript/protocol/controlSnapshotStore.d.ts.map +1 -0
- package/build/typescript/protocol/useProtocolExchange.d.ts +40 -0
- package/build/typescript/protocol/useProtocolExchange.d.ts.map +1 -0
- package/build/typescript/registries/ContentRegistry.d.ts +57 -0
- package/build/typescript/registries/ContentRegistry.d.ts.map +1 -0
- package/build/typescript/registries/FormFieldRegistry.d.ts +37 -0
- package/build/typescript/registries/FormFieldRegistry.d.ts.map +1 -0
- package/build/typescript/render/NodeBoundary.d.ts +25 -0
- package/build/typescript/render/NodeBoundary.d.ts.map +1 -0
- package/build/typescript/render/RenderTree.d.ts +23 -0
- package/build/typescript/render/RenderTree.d.ts.map +1 -0
- package/build/typescript/render/WorkflowRenderContext.d.ts +57 -0
- package/build/typescript/render/WorkflowRenderContext.d.ts.map +1 -0
- package/build/typescript/render/nodes.d.ts +49 -0
- package/build/typescript/render/nodes.d.ts.map +1 -0
- package/build/typescript/responsive/ResponsiveProvider.d.ts +39 -0
- package/build/typescript/responsive/ResponsiveProvider.d.ts.map +1 -0
- package/build/typescript/responsive/index.d.ts +3 -0
- package/build/typescript/responsive/index.d.ts.map +1 -0
- package/build/typescript/responsive/responsive.d.ts +24 -0
- package/build/typescript/responsive/responsive.d.ts.map +1 -0
- package/build/typescript/style/resolveDisplayHintStyle.d.ts +23 -0
- package/build/typescript/style/resolveDisplayHintStyle.d.ts.map +1 -0
- package/build/typescript/theme/WorkflowTheme.d.ts +177 -0
- package/build/typescript/theme/WorkflowTheme.d.ts.map +1 -0
- package/build/typescript/utils/testable.d.ts +8 -0
- package/build/typescript/utils/testable.d.ts.map +1 -0
- package/package.json +104 -3
- package/src/WorkflowFontScaleContext.tsx +74 -0
- package/src/adapter/WalletAdapter.tsx +225 -0
- package/src/components/FallbackVideoPlayer.native.tsx +9 -0
- package/src/components/FallbackVideoPlayer.tsx +5 -0
- package/src/components/FallbackVideoPlayer.web.tsx +24 -0
- package/src/components/WorkflowButtonLabel.tsx +41 -0
- package/src/components/WorkflowCalendarIcon.tsx +52 -0
- package/src/components/WorkflowText.tsx +121 -0
- package/src/content/BadgeContent.tsx +57 -0
- package/src/content/BarChartContent.tsx +76 -0
- package/src/content/BarcodeContent.tsx +59 -0
- package/src/content/BasicTableContent.tsx +139 -0
- package/src/content/ButtonContent.tsx +124 -0
- package/src/content/CalendarContent.tsx +178 -0
- package/src/content/CardContent.tsx +137 -0
- package/src/content/CarouselContent.tsx +197 -0
- package/src/content/ChipContent.tsx +209 -0
- package/src/content/ChipRowContent.tsx +133 -0
- package/src/content/CredentialOfferContent.tsx +229 -0
- package/src/content/DialContent.tsx +96 -0
- package/src/content/DividerContent.tsx +33 -0
- package/src/content/DonutChartContent.tsx +110 -0
- package/src/content/FormContent.tsx +158 -0
- package/src/content/FormFieldBridge.tsx +144 -0
- package/src/content/GaugeContent.tsx +66 -0
- package/src/content/GridLayoutContent.tsx +285 -0
- package/src/content/ImageContent.tsx +222 -0
- package/src/content/ListContent.tsx +98 -0
- package/src/content/LocationContent.tsx +135 -0
- package/src/content/MapContent.tsx +232 -0
- package/src/content/MultipleChoiceContent.tsx +74 -0
- package/src/content/OpenBadgePreviewContent.tsx +93 -0
- package/src/content/PhotoContent.tsx +110 -0
- package/src/content/PieChartContent.tsx +121 -0
- package/src/content/ProofPresentationContent.tsx +127 -0
- package/src/content/RadioButtonContent.tsx +129 -0
- package/src/content/RowContent.tsx +627 -0
- package/src/content/SectionContent.tsx +133 -0
- package/src/content/ShareEntryContent.tsx +109 -0
- package/src/content/SimulatedHint.tsx +20 -0
- package/src/content/SliderContent.tsx +56 -0
- package/src/content/SpacerContent.tsx +15 -0
- package/src/content/SpinnerContent.tsx +24 -0
- package/src/content/SubmitButtonContent.tsx +256 -0
- package/src/content/TextContent.tsx +140 -0
- package/src/content/TileContent.tsx +216 -0
- package/src/content/TimelineContent.tsx +91 -0
- package/src/content/TitleContent.tsx +49 -0
- package/src/content/VideoContent.tsx +131 -0
- package/src/content/WebLinkContent.tsx +87 -0
- package/src/content/index.ts +45 -0
- package/src/form-fields/CheckboxField.tsx +29 -0
- package/src/form-fields/DateField.native.tsx +123 -0
- package/src/form-fields/DateField.tsx +5 -0
- package/src/form-fields/DateField.web.tsx +32 -0
- package/src/form-fields/DropdownField.tsx +137 -0
- package/src/form-fields/MCQField.tsx +68 -0
- package/src/form-fields/RadioField.tsx +53 -0
- package/src/form-fields/SliderField.native.tsx +53 -0
- package/src/form-fields/SliderField.tsx +5 -0
- package/src/form-fields/SliderField.web.tsx +58 -0
- package/src/form-fields/SubmitButtonField.tsx +33 -0
- package/src/form-fields/TextField.tsx +49 -0
- package/src/form-fields/index.ts +12 -0
- package/src/i18n/WorkflowI18n.tsx +100 -0
- package/src/icons/VectorIcon.tsx +10 -0
- package/src/icons/VectorIcon.web.tsx +55 -0
- package/src/icons/WorkflowIcon.tsx +30 -0
- package/src/icons/types.ts +13 -0
- package/src/imageUriCache.ts +27 -0
- package/src/index.ts +97 -0
- package/src/modal/WorkflowModal.tsx +119 -0
- package/src/platform/platformName.ts +7 -0
- package/src/platform/platformName.web.ts +2 -0
- package/src/protocol/controlSnapshotStore.ts +25 -0
- package/src/protocol/useProtocolExchange.ts +185 -0
- package/src/registries/ContentRegistry.tsx +130 -0
- package/src/registries/FormFieldRegistry.tsx +83 -0
- package/src/render/NodeBoundary.tsx +69 -0
- package/src/render/RenderTree.tsx +63 -0
- package/src/render/WorkflowRenderContext.tsx +71 -0
- package/src/render/nodes.ts +104 -0
- package/src/responsive/ResponsiveProvider.tsx +103 -0
- package/src/responsive/index.ts +7 -0
- package/src/responsive/responsive.ts +67 -0
- package/src/style/resolveDisplayHintStyle.ts +153 -0
- package/src/theme/WorkflowTheme.tsx +162 -0
- package/src/utils/testable.ts +10 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import WorkflowText from '../components/WorkflowText'
|
|
4
|
+
import { WorkflowIcon } from '../icons/WorkflowIcon'
|
|
5
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
6
|
+
import { useResponsive } from '../responsive'
|
|
7
|
+
import { resolveItemSurfaceStyle } from '../style/resolveDisplayHintStyle'
|
|
8
|
+
|
|
9
|
+
const TextContent: React.FC<ContentProps> = ({ item, styles, colors }) => {
|
|
10
|
+
const { s } = useResponsive()
|
|
11
|
+
const text = item.text || ''
|
|
12
|
+
const type = item.type || 'text'
|
|
13
|
+
|
|
14
|
+
const getIconConfig = () => {
|
|
15
|
+
switch (type) {
|
|
16
|
+
case 'information':
|
|
17
|
+
return { name: 'info', color: '#2196F3' }
|
|
18
|
+
case 'warning':
|
|
19
|
+
return { name: 'warning', color: '#FF9800' }
|
|
20
|
+
case 'error':
|
|
21
|
+
return { name: 'error', color: '#F44336' }
|
|
22
|
+
case 'pass':
|
|
23
|
+
return { name: 'check-circle', color: '#4CAF50' }
|
|
24
|
+
case 'fail':
|
|
25
|
+
return { name: 'cancel', color: '#F44336' }
|
|
26
|
+
default:
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const iconConfig = getIconConfig()
|
|
32
|
+
|
|
33
|
+
if (type === 'text') {
|
|
34
|
+
const textColor = (typeof item.color === 'string' && item.color.trim()) || colors.text
|
|
35
|
+
const sizeRaw = item.size ?? item.fontSize
|
|
36
|
+
const size =
|
|
37
|
+
typeof sizeRaw === 'number' && Number.isFinite(sizeRaw)
|
|
38
|
+
? sizeRaw
|
|
39
|
+
: typeof sizeRaw === 'string' && /^\d+(\.\d+)?$/.test(sizeRaw)
|
|
40
|
+
? Number(sizeRaw)
|
|
41
|
+
: undefined
|
|
42
|
+
const weightRaw = item.fontWeight
|
|
43
|
+
const fontWeight =
|
|
44
|
+
weightRaw === '700' || weightRaw === 'bold' || weightRaw === 700
|
|
45
|
+
? ('700' as const)
|
|
46
|
+
: weightRaw === '600' || weightRaw === 600
|
|
47
|
+
? ('600' as const)
|
|
48
|
+
: weightRaw === '500' || weightRaw === 500
|
|
49
|
+
? ('500' as const)
|
|
50
|
+
: undefined
|
|
51
|
+
const lines =
|
|
52
|
+
typeof item.numberOfLines === 'number' && Number.isFinite(item.numberOfLines) ? item.numberOfLines : undefined
|
|
53
|
+
const lineHeightRaw = item.lineHeight
|
|
54
|
+
const lineHeight =
|
|
55
|
+
typeof lineHeightRaw === 'number' && Number.isFinite(lineHeightRaw)
|
|
56
|
+
? lineHeightRaw
|
|
57
|
+
: typeof lineHeightRaw === 'string' && /^\d+(\.\d+)?$/.test(lineHeightRaw)
|
|
58
|
+
? Number(lineHeightRaw)
|
|
59
|
+
: undefined
|
|
60
|
+
const textAlignRaw = String(item.textAlign || item.align || '').toLowerCase()
|
|
61
|
+
const textAlign =
|
|
62
|
+
textAlignRaw === 'center' || textAlignRaw === 'middle'
|
|
63
|
+
? ('center' as const)
|
|
64
|
+
: textAlignRaw === 'end' || textAlignRaw === 'right' || textAlignRaw === 'flex-end'
|
|
65
|
+
? ('right' as const)
|
|
66
|
+
: textAlignRaw === 'start' || textAlignRaw === 'left' || textAlignRaw === 'flex-start'
|
|
67
|
+
? ('left' as const)
|
|
68
|
+
: undefined
|
|
69
|
+
return (
|
|
70
|
+
<View
|
|
71
|
+
style={[
|
|
72
|
+
styles.fieldContainer,
|
|
73
|
+
resolveItemSurfaceStyle(item),
|
|
74
|
+
{
|
|
75
|
+
marginBottom: 0,
|
|
76
|
+
...(textAlign === 'right' ? { alignItems: 'flex-end' as const, width: '100%' as const } : null),
|
|
77
|
+
},
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
<WorkflowText
|
|
81
|
+
variant={fontWeight === '700' || fontWeight === '600' ? 'label' : 'body'}
|
|
82
|
+
size={size}
|
|
83
|
+
numberOfLines={lines}
|
|
84
|
+
style={{
|
|
85
|
+
color: textColor,
|
|
86
|
+
fontWeight,
|
|
87
|
+
width: textAlign === 'right' ? undefined : '100%',
|
|
88
|
+
...(lineHeight != null ? { lineHeight } : null),
|
|
89
|
+
...(textAlign != null ? { textAlign } : null),
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
{text}
|
|
93
|
+
</WorkflowText>
|
|
94
|
+
</View>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<View
|
|
100
|
+
style={[
|
|
101
|
+
styles.fieldContainer,
|
|
102
|
+
resolveItemSurfaceStyle(item),
|
|
103
|
+
{
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
alignItems: 'flex-start',
|
|
106
|
+
borderRadius: s(8),
|
|
107
|
+
borderWidth: 1,
|
|
108
|
+
borderColor: iconConfig?.color || colors.border,
|
|
109
|
+
minWidth: 0,
|
|
110
|
+
},
|
|
111
|
+
!item.bgColor
|
|
112
|
+
? {
|
|
113
|
+
backgroundColor: `${iconConfig?.color}15`,
|
|
114
|
+
}
|
|
115
|
+
: null,
|
|
116
|
+
]}
|
|
117
|
+
>
|
|
118
|
+
{iconConfig ? (
|
|
119
|
+
<WorkflowIcon
|
|
120
|
+
name={iconConfig.name}
|
|
121
|
+
size={s(24)}
|
|
122
|
+
color={iconConfig.color}
|
|
123
|
+
style={{ marginRight: s(12), marginTop: 2 }}
|
|
124
|
+
/>
|
|
125
|
+
) : null}
|
|
126
|
+
<WorkflowText variant="body" style={{ color: colors.text, flex: 1 }}>
|
|
127
|
+
{text}
|
|
128
|
+
</WorkflowText>
|
|
129
|
+
</View>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
ContentRegistry.register('text', TextContent)
|
|
134
|
+
ContentRegistry.register('information', TextContent)
|
|
135
|
+
ContentRegistry.register('warning', TextContent)
|
|
136
|
+
ContentRegistry.register('error', TextContent)
|
|
137
|
+
ContentRegistry.register('pass', TextContent)
|
|
138
|
+
ContentRegistry.register('fail', TextContent)
|
|
139
|
+
|
|
140
|
+
export default TextContent
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Image, TouchableOpacity, View } from 'react-native'
|
|
3
|
+
import WorkflowText from '../components/WorkflowText'
|
|
4
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
5
|
+
import { deriveNode } from '../render/nodes'
|
|
6
|
+
import { useResponsive } from '../responsive'
|
|
7
|
+
import { resolveAspectRatio, resolveItemBackgroundColor } from '../style/resolveDisplayHintStyle'
|
|
8
|
+
|
|
9
|
+
interface BadgeSpec {
|
|
10
|
+
label: string
|
|
11
|
+
tone?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const TOUCHABLE_CHILD_TYPES = new Set(['button', 'submit-button', 'chip', 'tile'])
|
|
15
|
+
|
|
16
|
+
const TileContent: React.FC<ContentProps> = ({
|
|
17
|
+
item,
|
|
18
|
+
colors,
|
|
19
|
+
onAction,
|
|
20
|
+
styles,
|
|
21
|
+
formData,
|
|
22
|
+
onFieldChange,
|
|
23
|
+
mediaFrame,
|
|
24
|
+
disabled,
|
|
25
|
+
}) => {
|
|
26
|
+
const { s, isSmall } = useResponsive()
|
|
27
|
+
const layout = (item.layout as string | undefined) ?? 'horizontal'
|
|
28
|
+
const title = (item.title as string | undefined) ?? ''
|
|
29
|
+
const subtitle = (item.subtitle as string | undefined) ?? ''
|
|
30
|
+
const text = (item.text as string | undefined) ?? ''
|
|
31
|
+
const bodyText = text && text.trim() === subtitle.trim() ? '' : text
|
|
32
|
+
const imageUrl = (item.image as string | undefined) ?? (item.url as string | undefined)
|
|
33
|
+
const badges = (item.badges as BadgeSpec[] | undefined) ?? []
|
|
34
|
+
const event = item.event as string | undefined
|
|
35
|
+
const input = item.input as Record<string, unknown> | undefined
|
|
36
|
+
const children = item.children as ContentProps['item'][] | undefined
|
|
37
|
+
|
|
38
|
+
const isVertical = layout === 'vertical'
|
|
39
|
+
const isSquare = resolveAspectRatio(item.aspectRatio ?? item.ratio) === 1
|
|
40
|
+
const tileSize = mediaFrame?.width ?? s(isSmall ? 160 : 180)
|
|
41
|
+
const tileWidth = isSquare ? tileSize : (mediaFrame?.width ?? ('100%' as const))
|
|
42
|
+
const imageSize = s(isSmall ? 72 : 88)
|
|
43
|
+
const imageStyle = isVertical
|
|
44
|
+
? isSquare
|
|
45
|
+
? {
|
|
46
|
+
width: '100%' as const,
|
|
47
|
+
flex: 1,
|
|
48
|
+
minHeight: 0,
|
|
49
|
+
borderRadius: s(8),
|
|
50
|
+
}
|
|
51
|
+
: {
|
|
52
|
+
width: '100%' as const,
|
|
53
|
+
height: mediaFrame?.height ?? s(isSmall ? 140 : 160),
|
|
54
|
+
borderRadius: s(8),
|
|
55
|
+
}
|
|
56
|
+
: { width: imageSize, height: imageSize, borderRadius: s(8) }
|
|
57
|
+
|
|
58
|
+
const actionChildren: ContentProps['item'][] = []
|
|
59
|
+
const contentChildren: ContentProps['item'][] = []
|
|
60
|
+
for (const c of children ?? []) {
|
|
61
|
+
if (c && TOUCHABLE_CHILD_TYPES.has(String(c.type))) actionChildren.push(c)
|
|
62
|
+
else contentChildren.push(c)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const TitleBlock = title ? (
|
|
66
|
+
<WorkflowText variant="title" numberOfLines={1} style={{ color: colors.text, width: '100%' }}>
|
|
67
|
+
{title}
|
|
68
|
+
</WorkflowText>
|
|
69
|
+
) : null
|
|
70
|
+
|
|
71
|
+
const MetaBlock = (
|
|
72
|
+
<View style={{ minWidth: 0, justifyContent: 'center', gap: s(4), ...(isVertical ? null : { flex: 1 }) }}>
|
|
73
|
+
{!isVertical ? TitleBlock : null}
|
|
74
|
+
{subtitle ? (
|
|
75
|
+
<WorkflowText variant="subtitle" numberOfLines={2} style={{ color: colors.text, opacity: 0.7, width: '100%' }}>
|
|
76
|
+
{subtitle}
|
|
77
|
+
</WorkflowText>
|
|
78
|
+
) : null}
|
|
79
|
+
{bodyText ? (
|
|
80
|
+
<WorkflowText variant="caption" numberOfLines={2} style={{ color: colors.text, opacity: 0.7, width: '100%' }}>
|
|
81
|
+
{bodyText}
|
|
82
|
+
</WorkflowText>
|
|
83
|
+
) : null}
|
|
84
|
+
{badges.length > 0 ? (
|
|
85
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: s(6), marginTop: s(4) }}>
|
|
86
|
+
{badges.map((b, i) => (
|
|
87
|
+
<View key={`tile-badge-${i}`} style={{ maxWidth: '100%' }}>
|
|
88
|
+
{ContentRegistry.render('badge', {
|
|
89
|
+
item: { type: 'badge', label: b.label, tone: b.tone },
|
|
90
|
+
onAction,
|
|
91
|
+
styles,
|
|
92
|
+
colors,
|
|
93
|
+
formData,
|
|
94
|
+
onFieldChange,
|
|
95
|
+
})}
|
|
96
|
+
</View>
|
|
97
|
+
))}
|
|
98
|
+
</View>
|
|
99
|
+
) : null}
|
|
100
|
+
{contentChildren.map((child, i) =>
|
|
101
|
+
ContentRegistry.has(child.type) ? (
|
|
102
|
+
<View key={`tile-cc-${i}`} style={{ minWidth: 0 }}>
|
|
103
|
+
{ContentRegistry.render(child.type, {
|
|
104
|
+
item: child,
|
|
105
|
+
onAction,
|
|
106
|
+
styles,
|
|
107
|
+
colors,
|
|
108
|
+
formData,
|
|
109
|
+
onFieldChange,
|
|
110
|
+
disabled,
|
|
111
|
+
})}
|
|
112
|
+
</View>
|
|
113
|
+
) : null
|
|
114
|
+
)}
|
|
115
|
+
</View>
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
const PrimaryRegion = (
|
|
119
|
+
<View
|
|
120
|
+
style={{
|
|
121
|
+
flexDirection: isVertical ? 'column' : 'row',
|
|
122
|
+
gap: isVertical && isSquare ? s(6) : s(12),
|
|
123
|
+
flex: 1,
|
|
124
|
+
minWidth: 0,
|
|
125
|
+
minHeight: 0,
|
|
126
|
+
alignItems: isVertical ? 'stretch' : 'center',
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
{isVertical && title ? <View style={{ flexShrink: 0, width: '100%' }}>{TitleBlock}</View> : null}
|
|
130
|
+
{imageUrl ? (
|
|
131
|
+
<View
|
|
132
|
+
style={
|
|
133
|
+
isVertical && isSquare
|
|
134
|
+
? { flex: 1, minHeight: 0, width: '100%', overflow: 'hidden', borderRadius: s(8) }
|
|
135
|
+
: undefined
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
<Image
|
|
139
|
+
source={{ uri: imageUrl }}
|
|
140
|
+
style={isVertical && isSquare ? { width: '100%', height: '100%' } : imageStyle}
|
|
141
|
+
resizeMode="cover"
|
|
142
|
+
/>
|
|
143
|
+
</View>
|
|
144
|
+
) : null}
|
|
145
|
+
{isVertical ? <View style={{ flexShrink: 0, width: '100%', minWidth: 0 }}>{MetaBlock}</View> : MetaBlock}
|
|
146
|
+
</View>
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
const ActionColumn = actionChildren.length > 0 && (
|
|
150
|
+
<View
|
|
151
|
+
style={{
|
|
152
|
+
flexDirection: isVertical ? 'row' : 'column',
|
|
153
|
+
gap: s(6),
|
|
154
|
+
alignItems: isVertical ? 'stretch' : 'flex-end',
|
|
155
|
+
justifyContent: 'center',
|
|
156
|
+
flexShrink: 0,
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
{actionChildren.map((child, i) =>
|
|
160
|
+
ContentRegistry.has(child.type) ? (
|
|
161
|
+
<View key={`tile-ac-${i}`}>
|
|
162
|
+
{ContentRegistry.render(child.type, {
|
|
163
|
+
item: deriveNode(child, { compact: true }),
|
|
164
|
+
onAction,
|
|
165
|
+
styles,
|
|
166
|
+
colors,
|
|
167
|
+
formData,
|
|
168
|
+
onFieldChange,
|
|
169
|
+
disabled,
|
|
170
|
+
})}
|
|
171
|
+
</View>
|
|
172
|
+
) : null
|
|
173
|
+
)}
|
|
174
|
+
</View>
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<View
|
|
179
|
+
style={{
|
|
180
|
+
flexDirection: isVertical ? 'column' : 'row',
|
|
181
|
+
alignItems: isVertical ? 'stretch' : 'center',
|
|
182
|
+
padding: s(12),
|
|
183
|
+
borderRadius: s(12),
|
|
184
|
+
borderWidth: 1,
|
|
185
|
+
borderColor: colors.border,
|
|
186
|
+
backgroundColor: resolveItemBackgroundColor(item) ?? colors.background,
|
|
187
|
+
width: tileWidth,
|
|
188
|
+
maxWidth: isSquare ? tileSize : '100%',
|
|
189
|
+
height: isSquare ? tileSize : undefined,
|
|
190
|
+
alignSelf: isSquare ? 'flex-start' : 'stretch',
|
|
191
|
+
gap: isSquare && isVertical ? s(6) : s(12),
|
|
192
|
+
minWidth: 0,
|
|
193
|
+
overflow: 'hidden',
|
|
194
|
+
...(mediaFrame && !isSquare ? { height: '100%' as const, flex: 1 } : null),
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
{event ? (
|
|
198
|
+
<TouchableOpacity
|
|
199
|
+
activeOpacity={0.85}
|
|
200
|
+
disabled={disabled}
|
|
201
|
+
onPress={() => onAction(event, input ?? {})}
|
|
202
|
+
style={[{ flex: 1, minWidth: 0, minHeight: 0 }, disabled ? { opacity: 0.5 } : null]}
|
|
203
|
+
>
|
|
204
|
+
{PrimaryRegion}
|
|
205
|
+
</TouchableOpacity>
|
|
206
|
+
) : (
|
|
207
|
+
PrimaryRegion
|
|
208
|
+
)}
|
|
209
|
+
{ActionColumn}
|
|
210
|
+
</View>
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
ContentRegistry.register('tile', TileContent)
|
|
215
|
+
|
|
216
|
+
export default TileContent
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { StyleSheet, View } from 'react-native'
|
|
3
|
+
import WorkflowText from '../components/WorkflowText'
|
|
4
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
5
|
+
import { useResponsive } from '../responsive'
|
|
6
|
+
import { resolveItemSurfaceStyle } from '../style/resolveDisplayHintStyle'
|
|
7
|
+
|
|
8
|
+
interface TimelineEntry {
|
|
9
|
+
order: number | string
|
|
10
|
+
entry: string
|
|
11
|
+
text: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const parseOrder = (order: number | string): number => {
|
|
15
|
+
if (typeof order === 'number') return order
|
|
16
|
+
return parseInt(order, 10) || 0
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const DEFAULT_ENTRIES: TimelineEntry[] = [
|
|
20
|
+
{ order: 1, entry: 'Step 1', text: 'Application submitted' },
|
|
21
|
+
{ order: 2, entry: 'Step 2', text: 'Under review' },
|
|
22
|
+
{ order: 3, entry: 'Step 3', text: 'Approved' },
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
const TimelineContent: React.FC<ContentProps> = ({ item, colors }) => {
|
|
26
|
+
const { s } = useResponsive()
|
|
27
|
+
const rawEntries: TimelineEntry[] = item.entries || []
|
|
28
|
+
const entries = rawEntries.length > 0 ? rawEntries : DEFAULT_ENTRIES
|
|
29
|
+
const sortedEntries = [...entries].sort((a, b) => parseOrder(a.order) - parseOrder(b.order))
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<View style={[sLocal.wrap, resolveItemSurfaceStyle(item)]}>
|
|
33
|
+
{item.title ? (
|
|
34
|
+
<WorkflowText variant="title" style={{ color: colors.text, marginBottom: s(16), fontWeight: '700' }}>
|
|
35
|
+
{item.title}
|
|
36
|
+
</WorkflowText>
|
|
37
|
+
) : null}
|
|
38
|
+
|
|
39
|
+
{sortedEntries.map((entry, index) => {
|
|
40
|
+
const isLast = index === sortedEntries.length - 1
|
|
41
|
+
return (
|
|
42
|
+
<View key={index} style={sLocal.row}>
|
|
43
|
+
<View style={[sLocal.rail, { marginRight: s(16), width: s(16) }]}>
|
|
44
|
+
<View
|
|
45
|
+
style={[
|
|
46
|
+
sLocal.dot,
|
|
47
|
+
{
|
|
48
|
+
backgroundColor: colors.primary,
|
|
49
|
+
borderColor: colors.background,
|
|
50
|
+
width: s(16),
|
|
51
|
+
height: s(16),
|
|
52
|
+
borderRadius: s(8),
|
|
53
|
+
},
|
|
54
|
+
]}
|
|
55
|
+
/>
|
|
56
|
+
{!isLast ? (
|
|
57
|
+
<View style={[sLocal.line, { backgroundColor: `${colors.primary}55`, minHeight: s(20) }]} />
|
|
58
|
+
) : null}
|
|
59
|
+
</View>
|
|
60
|
+
|
|
61
|
+
<View style={[sLocal.content, { paddingBottom: isLast ? 0 : s(20), minWidth: 0 }]}>
|
|
62
|
+
<WorkflowText variant="label" size={14} style={{ color: colors.text, marginBottom: s(2) }}>
|
|
63
|
+
{entry.entry}
|
|
64
|
+
</WorkflowText>
|
|
65
|
+
{entry.text ? (
|
|
66
|
+
<WorkflowText variant="caption" size={13} style={{ color: colors.text, opacity: 0.85 }}>
|
|
67
|
+
{entry.text}
|
|
68
|
+
</WorkflowText>
|
|
69
|
+
) : null}
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
)
|
|
73
|
+
})}
|
|
74
|
+
</View>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const sLocal = StyleSheet.create({
|
|
79
|
+
wrap: { marginBottom: 8 },
|
|
80
|
+
row: { flexDirection: 'row' },
|
|
81
|
+
rail: { alignItems: 'center' },
|
|
82
|
+
dot: {
|
|
83
|
+
borderWidth: 3,
|
|
84
|
+
},
|
|
85
|
+
line: { width: 2, flex: 1 },
|
|
86
|
+
content: { flex: 1 },
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
ContentRegistry.register('timeline', TimelineContent)
|
|
90
|
+
|
|
91
|
+
export default TimelineContent
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import WorkflowText from '../components/WorkflowText'
|
|
4
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
5
|
+
import { resolveItemSurfaceStyle } from '../style/resolveDisplayHintStyle'
|
|
6
|
+
|
|
7
|
+
const TitleContent: React.FC<ContentProps> = ({ item, styles, colors, fillContainer }) => {
|
|
8
|
+
const raw = String(item.text || item.title || item.label || '')
|
|
9
|
+
const subtitleRaw = item.subtitle || item.content || ''
|
|
10
|
+
const parts = raw.split('\n')
|
|
11
|
+
const titleLine = parts[0] || ''
|
|
12
|
+
const subtitle = String(subtitleRaw || parts.slice(1).join('\n') || '')
|
|
13
|
+
const titleColor = (typeof item.color === 'string' && item.color.trim()) || colors.text || '#FFFFFF'
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View
|
|
17
|
+
style={[
|
|
18
|
+
styles.fieldContainer,
|
|
19
|
+
resolveItemSurfaceStyle(item),
|
|
20
|
+
fillContainer
|
|
21
|
+
? {
|
|
22
|
+
marginBottom: 0,
|
|
23
|
+
flex: 1,
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
minWidth: 0,
|
|
26
|
+
}
|
|
27
|
+
: { marginBottom: 0 },
|
|
28
|
+
{ gap: 2 },
|
|
29
|
+
]}
|
|
30
|
+
>
|
|
31
|
+
<WorkflowText
|
|
32
|
+
variant={fillContainer ? 'title' : 'heading'}
|
|
33
|
+
numberOfLines={1}
|
|
34
|
+
style={{ color: titleColor, marginBottom: 0, width: '100%' }}
|
|
35
|
+
>
|
|
36
|
+
{titleLine}
|
|
37
|
+
</WorkflowText>
|
|
38
|
+
{subtitle ? (
|
|
39
|
+
<WorkflowText variant="body" numberOfLines={2} style={{ color: titleColor, opacity: 0.78, width: '100%' }}>
|
|
40
|
+
{subtitle}
|
|
41
|
+
</WorkflowText>
|
|
42
|
+
) : null}
|
|
43
|
+
</View>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ContentRegistry.register('title', TitleContent)
|
|
48
|
+
|
|
49
|
+
export default TitleContent
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react'
|
|
2
|
+
import { Image, Platform, Pressable, StyleSheet, Text, View } from 'react-native'
|
|
3
|
+
import { useWalletAdapter } from '../adapter/WalletAdapter'
|
|
4
|
+
import FallbackVideoPlayer from '../components/FallbackVideoPlayer'
|
|
5
|
+
import { useWorkflowT } from '../i18n/WorkflowI18n'
|
|
6
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
7
|
+
import { resolveFrameShadow, resolveSurfaceBackground } from '../style/resolveDisplayHintStyle'
|
|
8
|
+
|
|
9
|
+
const DEFAULT_RADIUS = 16
|
|
10
|
+
const FALLBACK_POSTERS = [
|
|
11
|
+
'https://picsum.photos/id/1015/1200/675',
|
|
12
|
+
'https://picsum.photos/id/1016/1200/675',
|
|
13
|
+
'https://images.unsplash.com/photo-1562774053-701939374585?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&h=675&q=80',
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Video with a poster and play button. The player is the app's
|
|
18
|
+
* (`adapter.VideoPlayer`, the wallet's expo-video view); on the web without
|
|
19
|
+
* one, the browser's `<video>` plays it.
|
|
20
|
+
*/
|
|
21
|
+
const VideoContent: React.FC<ContentProps> = ({ item, styles, colors }) => {
|
|
22
|
+
const t = useWorkflowT()
|
|
23
|
+
const adapter = useWalletAdapter()
|
|
24
|
+
const [playing, setPlaying] = useState(false)
|
|
25
|
+
const [failed, setFailed] = useState(false)
|
|
26
|
+
const [posterIndex, setPosterIndex] = useState(0)
|
|
27
|
+
|
|
28
|
+
const videoUrl =
|
|
29
|
+
(item['video-url'] as string | undefined) ||
|
|
30
|
+
(item.url as string | undefined) ||
|
|
31
|
+
(item.videoUrl as string | undefined)
|
|
32
|
+
|
|
33
|
+
const posterCandidates = useMemo(() => {
|
|
34
|
+
const fromItem = [item.thumbnail, item.poster, item['poster-url'], item.image, item['image-url']].filter(
|
|
35
|
+
(v): v is string => typeof v === 'string' && v.trim().length > 0
|
|
36
|
+
)
|
|
37
|
+
return [...fromItem, ...FALLBACK_POSTERS]
|
|
38
|
+
}, [item])
|
|
39
|
+
|
|
40
|
+
if (!videoUrl) return null
|
|
41
|
+
|
|
42
|
+
const poster = posterCandidates[Math.min(posterIndex, posterCandidates.length - 1)]
|
|
43
|
+
const autoPlay = item['auto-play'] === true || item['auto-play'] === 'true'
|
|
44
|
+
const Player = adapter.VideoPlayer ?? (Platform.OS === 'web' ? FallbackVideoPlayer : undefined)
|
|
45
|
+
const showPlayer = (playing || autoPlay) && !!Player && !failed
|
|
46
|
+
const videoHeight = (item.orientation || 'landscape') === 'portrait' ? 400 : 220
|
|
47
|
+
const surfaceBg = resolveSurfaceBackground(item.bgColor as string | undefined)
|
|
48
|
+
const radius =
|
|
49
|
+
typeof item.borderRadius === 'number' && Number.isFinite(item.borderRadius) ? item.borderRadius : DEFAULT_RADIUS
|
|
50
|
+
const frameBg =
|
|
51
|
+
surfaceBg === 'transparent' || surfaceBg === '#111111' || surfaceBg === '#000000' ? '#1A1A1A' : surfaceBg
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<View style={[styles.fieldContainer, { backgroundColor: 'transparent', marginBottom: 0 }]}>
|
|
55
|
+
{item.label ? (
|
|
56
|
+
<Text style={[styles.label, { color: colors.text, marginBottom: 8 }]}>{String(item.label)}</Text>
|
|
57
|
+
) : null}
|
|
58
|
+
<View
|
|
59
|
+
style={[
|
|
60
|
+
{ width: '100%', height: videoHeight, backgroundColor: frameBg, borderRadius: radius, overflow: 'hidden' },
|
|
61
|
+
resolveFrameShadow(item.shadow ?? true),
|
|
62
|
+
]}
|
|
63
|
+
>
|
|
64
|
+
{showPlayer && Player ? (
|
|
65
|
+
<Player uri={videoUrl} autoPlay={autoPlay} style={v.fill} onError={() => setFailed(true)} />
|
|
66
|
+
) : (
|
|
67
|
+
<View style={v.fill}>
|
|
68
|
+
<Image
|
|
69
|
+
key={poster}
|
|
70
|
+
source={{ uri: poster }}
|
|
71
|
+
style={v.poster}
|
|
72
|
+
resizeMode="cover"
|
|
73
|
+
onError={() => setPosterIndex((prev) => (prev + 1 < posterCandidates.length ? prev + 1 : prev))}
|
|
74
|
+
/>
|
|
75
|
+
{failed ? (
|
|
76
|
+
<View style={[v.overlay, { padding: 16 }]}>
|
|
77
|
+
<Text style={{ color: colors.text, textAlign: 'center' }}>{t('WorkflowUi.VideoFailed')}</Text>
|
|
78
|
+
</View>
|
|
79
|
+
) : (
|
|
80
|
+
<Pressable
|
|
81
|
+
style={v.overlay}
|
|
82
|
+
onPress={() => setPlaying(true)}
|
|
83
|
+
accessibilityRole="button"
|
|
84
|
+
accessibilityLabel={String(item.label || 'Play video')}
|
|
85
|
+
>
|
|
86
|
+
<View style={v.playCircle}>
|
|
87
|
+
<View style={v.playTriangle} />
|
|
88
|
+
</View>
|
|
89
|
+
</Pressable>
|
|
90
|
+
)}
|
|
91
|
+
</View>
|
|
92
|
+
)}
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const v = StyleSheet.create({
|
|
99
|
+
fill: { width: '100%', height: '100%' },
|
|
100
|
+
poster: { ...StyleSheet.absoluteFillObject, width: '100%', height: '100%' },
|
|
101
|
+
overlay: {
|
|
102
|
+
...StyleSheet.absoluteFillObject,
|
|
103
|
+
justifyContent: 'center',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
backgroundColor: 'rgba(0,0,0,0.18)',
|
|
106
|
+
},
|
|
107
|
+
playCircle: {
|
|
108
|
+
width: 72,
|
|
109
|
+
height: 72,
|
|
110
|
+
borderRadius: 36,
|
|
111
|
+
backgroundColor: 'rgba(255,255,255,0.94)',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
justifyContent: 'center',
|
|
114
|
+
},
|
|
115
|
+
playTriangle: {
|
|
116
|
+
width: 0,
|
|
117
|
+
height: 0,
|
|
118
|
+
marginLeft: 5,
|
|
119
|
+
borderStyle: 'solid',
|
|
120
|
+
borderTopWidth: 12,
|
|
121
|
+
borderBottomWidth: 12,
|
|
122
|
+
borderLeftWidth: 20,
|
|
123
|
+
borderTopColor: 'transparent',
|
|
124
|
+
borderBottomColor: 'transparent',
|
|
125
|
+
borderLeftColor: '#111111',
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
ContentRegistry.register('video', VideoContent)
|
|
130
|
+
|
|
131
|
+
export default VideoContent
|