@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
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2020-present Hyperledger Contributors.
|
|
190
|
+
Copyright 2021 Queen’s Printer for Ontario. Mostafa Youssef (https://github.com/MosCD3), Amit Padmani (https://github.com/nbAmit), Prasad Katkar (https://github.com/NB-PrasadKatkar), Mike Richardson (https://github.com/NB-MikeRichardson)
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,218 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @veridid/workflow-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Native components for workflow display hints, written once and used in
|
|
4
|
+
two places:
|
|
5
|
+
|
|
6
|
+
| Consumer | How it renders |
|
|
7
|
+
|---|---|
|
|
8
|
+
| DigiCred wallet | natively, bundled by Metro |
|
|
9
|
+
| CrMS workflow designer | in the browser through `react-native-web`, bundled by Vite |
|
|
10
|
+
|
|
11
|
+
The **wallet is the reference renderer**: components are written for the best
|
|
12
|
+
result on the phone and the web adapts. Logic (hint selection, `showWhen`,
|
|
13
|
+
`enabledWhen`, interpolation) comes from `@veridid/workflow-core`.
|
|
14
|
+
|
|
15
|
+
## What's here
|
|
16
|
+
|
|
17
|
+
| Area | Contents | Status |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| Registries | `ContentRegistry`, `FormFieldRegistry` (map a display-hint `type` to its renderer) | available |
|
|
20
|
+
| Layout, text, data | `title`, `text` (+ `information`/`warning`/`error`/`pass`/`fail`), `divider`, `spacer`, `badge`, `chip`, `chip-row`, `image`, `row`, `section`, `card`, `grid-layout`, `list`, `carousel`, `tile`, `basic-table`, `timeline`, `bar-chart`, `pie-chart`, `donut-chart`, `gauge`, `dial`, plus the wallet's aliases | available (from the wallet's `ui-elements`) |
|
|
21
|
+
| Providers | `ResponsiveProvider` (with `size`), `WorkflowFontScaleProvider`, `WorkflowThemeProvider`, `WorkflowI18nProvider`, `WorkflowIconProvider`, `WalletAdapterProvider`, `WorkflowModalHost` | available |
|
|
22
|
+
| Forms | `form` (inputs and display children), `text-input`, `text-area`, `check-box`, `radio-button`, `multiple-choice`, `drop-down`, `date`, `slider`, `submit-button` (with `input_schema`), plus the wallet's field aliases | available |
|
|
23
|
+
| Actions and misc | `button` (`actionID` or `event`), `web-link`, `spinner` | available |
|
|
24
|
+
| Identity | `credential-offer`, `proof-presentation` (credo replaced by the adapter), `open-badge-preview` (from the designer), `share-entry` | available |
|
|
25
|
+
| Screen rendering | `RenderTree`, `WorkflowRenderProvider` (expressions per node, designer hooks) | available |
|
|
26
|
+
| Device and media | `photo`, `barcode` / `qr-code`, `location`, `map`, `video`, `calendar` (device access through the adapter) | available |
|
|
27
|
+
|
|
28
|
+
Importing the package registers the components (a side effect), so the
|
|
29
|
+
package does not declare `"sideEffects": false`.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { RenderTree, ResponsiveProvider } from '@veridid/workflow-ui'
|
|
33
|
+
|
|
34
|
+
<ResponsiveProvider>
|
|
35
|
+
<RenderTree items={items} onAction={onAction} formData={formData} onFieldChange={setField} />
|
|
36
|
+
</ResponsiveProvider>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## App providers
|
|
40
|
+
|
|
41
|
+
Every provider is optional; without them the controls look and behave like the
|
|
42
|
+
DigiCred wallet, in English, with a simulated device.
|
|
43
|
+
|
|
44
|
+
| Provider | What the app supplies | Wallet | Designer |
|
|
45
|
+
|---|---|---|---|
|
|
46
|
+
| `WorkflowThemeProvider` | Colours, host `styles` (`fieldContainer`, `label`, `input`, `button`, …), credential-card colours. Props passed to a control still win. | its palette (defaults are the wallet's) | the same wallet look, whatever the dashboard theme |
|
|
47
|
+
| `WorkflowI18nProvider` | `translate(key, english, params)`; keys match the wallet's (`Workflow.*`, `Global.*`) | `(k, d, p) => t(k, { defaultValue: d, ...p })` | English (default) |
|
|
48
|
+
| `WorkflowIconProvider` | `renderIcon({ name, set, size, color })` | none (vector icons on native, font glyphs on web) | optional, to use the app's own icon set |
|
|
49
|
+
| `WalletAdapterProvider` | device, links, alerts, credential/proof exchanges (below) | real adapter | `createSimulatedWalletAdapter({ onEvent })` |
|
|
50
|
+
| `ResponsiveProvider size` | the screen to lay out for | none (window) | the phone frame, e.g. `{ width: 390, height: 844 }` |
|
|
51
|
+
| `WorkflowModalHost` | where popups open | none (RN `Modal`) | around the phone frame |
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<ResponsiveProvider size={{ width: 390, height: 844 }}>
|
|
55
|
+
<WalletAdapterProvider adapter={simulated}>
|
|
56
|
+
<WorkflowModalHost style={{ flex: 1 }}>
|
|
57
|
+
<RenderTree items={items} onAction={log} />
|
|
58
|
+
</WorkflowModalHost>
|
|
59
|
+
</WalletAdapterProvider>
|
|
60
|
+
</ResponsiveProvider>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### WalletAdapter
|
|
64
|
+
|
|
65
|
+
The shared controls never import a native module, credo or navigation. They
|
|
66
|
+
call the adapter (create it once; members named `use…` are hooks):
|
|
67
|
+
|
|
68
|
+
| Member | Used by | Wallet implementation (moved from the old controls) |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `capturePhoto()` | `photo` | the camera modal (vision-camera + permission) |
|
|
71
|
+
| `scanBarcode()` | `barcode` | navigate to the Scan screen, resolve `null` |
|
|
72
|
+
| `getLocation()` | `location` | `ensureLocationPermission` + `getCurrentCoordinates` |
|
|
73
|
+
| `share()`, `exportPdf()` | `location`, `share-entry` | react-native-share, react-native-html-to-pdf |
|
|
74
|
+
| `addCalendarEvent()` | `calendar` | expo-calendar (permission, default/primary calendar) |
|
|
75
|
+
| `VideoPlayer` | `video` | expo-video `VideoView` |
|
|
76
|
+
| `openUrl()`, `alert()` | `web-link`, `dial`, `map`, errors | `Linking.openURL`, `Alert.alert` |
|
|
77
|
+
| `useExchanges(kind)` | offer, proof | `useCredentialByState` / `useProofByState`, mapped to `pending` / `success` / `declined` / `failed` |
|
|
78
|
+
| `acceptExchange`, `declineExchange` | offer, proof | `acceptOffer` (+ `ensureCredentialMetadata`), `acceptRequest`, decline |
|
|
79
|
+
| `getOfferedAttributes(id)` | offer | `credentials.getFormatData(id).offerAttributes` |
|
|
80
|
+
| `useCredentialCard()` | offer | `useOcaSvg` + `OcaSvgWebView`, `CredentialSVGRenderer`, `CredentialCardGen` |
|
|
81
|
+
| `openCredential(id)` | offer | navigate to CredentialDetails |
|
|
82
|
+
|
|
83
|
+
The simulated adapter returns sample data (a grey photo, a sample code,
|
|
84
|
+
Wilmington NC coordinates), logs share / PDF / calendar calls through
|
|
85
|
+
`onEvent`, and makes a waited-for offer or proof request arrive and complete,
|
|
86
|
+
so the designer can click through a credential offer. Controls show a small
|
|
87
|
+
"Simulated on the web" line when the adapter is simulated. On native, a
|
|
88
|
+
missing provider logs a warning in development.
|
|
89
|
+
|
|
90
|
+
On the web, `video` falls back to the browser's `<video>` element
|
|
91
|
+
(`FallbackVideoPlayer.web.tsx`) when the adapter has no player.
|
|
92
|
+
|
|
93
|
+
## Rendering a screen
|
|
94
|
+
|
|
95
|
+
Every node the registries render, wherever it sits (top level, inside a card,
|
|
96
|
+
a row, a form), goes through the same boundary:
|
|
97
|
+
|
|
98
|
+
- `disabled: true` on the item disables the control (the engine sets it from
|
|
99
|
+
`enabledWhen`). Before, only chips read it.
|
|
100
|
+
- With a `WorkflowRenderProvider` that has an `env`, `showWhen`, `enabledWhen`
|
|
101
|
+
and `{{ }}` are evaluated per node with `@veridid/workflow-core`, the
|
|
102
|
+
engine's own functions. Form values are added under `input`, so
|
|
103
|
+
`showWhen: "input.answer == 'no'"` updates as the user types.
|
|
104
|
+
- `renderNodeWrapper` wraps every node that has a path, for selection and
|
|
105
|
+
drag handles in the designer.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { resolveView } from '@veridid/workflow-core'
|
|
109
|
+
import { RenderTree, WorkflowRenderProvider } from '@veridid/workflow-ui'
|
|
110
|
+
|
|
111
|
+
// Wallet: items come resolved from the engine. No provider is needed;
|
|
112
|
+
// add one with the instance env to re-check conditions against form input.
|
|
113
|
+
<RenderTree items={items} onAction={advance} styles={styles} colors={colors}
|
|
114
|
+
formData={formData} onFieldChange={setField} />
|
|
115
|
+
|
|
116
|
+
// Designer: resolve the template, then wrap nodes for editing.
|
|
117
|
+
<WorkflowRenderProvider
|
|
118
|
+
env={simulatedEnv}
|
|
119
|
+
keepHidden // show showWhen-hidden nodes, dimmed by the wrapper
|
|
120
|
+
renderUnknown={(item) => <Placeholder type={item.type} />}
|
|
121
|
+
renderNodeWrapper={(element, { path, hidden }) => (
|
|
122
|
+
<Selectable path={path} dimmed={hidden}>{element}</Selectable>
|
|
123
|
+
)}
|
|
124
|
+
>
|
|
125
|
+
<RenderTree items={resolveView(hints, state, simulatedEnv)} {...shared} />
|
|
126
|
+
</WorkflowRenderProvider>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Paths look like `[1, 'children', 0]` (first child of the second item).
|
|
130
|
+
Pieces a component draws for itself (a tile's badge, a row turned into a
|
|
131
|
+
chip strip) are not nodes and are not wrapped. A container that adjusts a
|
|
132
|
+
child before rendering it uses `deriveNode(child, overrides)` so the copy keeps
|
|
133
|
+
the child's path.
|
|
134
|
+
|
|
135
|
+
`bind`, `row_template`, `audience` and `profile` stay engine-side
|
|
136
|
+
(`filterAndBindUi` / `resolveView`); they are not re-run per node.
|
|
137
|
+
|
|
138
|
+
## Tests
|
|
139
|
+
|
|
140
|
+
`pnpm vitest run --project workflow-ui` renders every component through
|
|
141
|
+
react-native-web in jsdom (the designer's path). Native rendering is covered by
|
|
142
|
+
the wallet's own tests. `icons.test.tsx` checks that every icon a control uses
|
|
143
|
+
has a web glyph. The carousel needs real
|
|
144
|
+
layout, so it is only checked for mounting here.
|
|
145
|
+
|
|
146
|
+
### Form children
|
|
147
|
+
|
|
148
|
+
Inside a `form`, registered form-field types render as inputs; everything else
|
|
149
|
+
(`title`, a paragraph `text`, `divider`, …) renders as a display item and
|
|
150
|
+
never produces a form value. `text` with a `name` / `form-id` is the legacy
|
|
151
|
+
text input.
|
|
152
|
+
|
|
153
|
+
## Platform files
|
|
154
|
+
|
|
155
|
+
Controls whose native library cannot (or should not) run in a browser ship
|
|
156
|
+
two files side by side: `DateField` (the native picker has no web build) and
|
|
157
|
+
`SliderField` (the community slider pulls a second react-native-web copy into
|
|
158
|
+
web bundles) already do; device controls will follow the same pattern:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
PhotoContent.tsx ← wallet: uses the native adapter
|
|
162
|
+
PhotoContent.web.tsx ← designer: same-size placeholder, simulated result
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The build (react-native-builder-bob) transforms each file separately and keeps
|
|
166
|
+
`./PhotoContent` imports unchanged, so each bundler picks its own file. Web
|
|
167
|
+
consumers must list `.web.*` extensions first (CrMS `vite.config.ts` does).
|
|
168
|
+
|
|
169
|
+
### Icons on the web
|
|
170
|
+
|
|
171
|
+
`react-native-vector-icons` cannot load in a browser (Flow source, and a native
|
|
172
|
+
module lookup at import time), so `icons/VectorIcon.web.tsx` draws the icons the
|
|
173
|
+
controls use as text in the same fonts. The web page loads the fonts once:
|
|
174
|
+
|
|
175
|
+
```css
|
|
176
|
+
@font-face { font-family: 'MaterialIcons'; src: url('react-native-vector-icons/Fonts/MaterialIcons.ttf'); }
|
|
177
|
+
@font-face { font-family: 'MaterialCommunityIcons'; src: url('react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf'); }
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
When a control starts using a new icon, add its codepoint to `WEB_GLYPHS`.
|
|
181
|
+
|
|
182
|
+
## Rules (enforced by biome)
|
|
183
|
+
|
|
184
|
+
- No `react-dom` or DOM globals (`window`, `document`, …) outside `*.web.*` files.
|
|
185
|
+
- No native-only modules (camera, geolocation, share, …) outside `*.native.*` files.
|
|
186
|
+
Device access goes through the `WalletAdapter` passed in by each app.
|
|
187
|
+
- No app-specific imports (bifold, credo, navigation, i18n libraries): each app
|
|
188
|
+
passes theme, translations, icons and callbacks in through providers.
|
|
189
|
+
|
|
190
|
+
## Install
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
# React Native app (the wallet)
|
|
194
|
+
yarn add @veridid/workflow-ui react-native-svg react-native-vector-icons \
|
|
195
|
+
@react-native-community/datetimepicker @react-native-community/slider
|
|
196
|
+
|
|
197
|
+
# Web (the CrMS designer)
|
|
198
|
+
npm install @veridid/workflow-ui react-dom react-native-web react-native-svg
|
|
199
|
+
# plus react-native-vector-icons, only for its .ttf fonts (see Icons on the web)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
| Peer | Needed by | Why |
|
|
203
|
+
|---|---|---|
|
|
204
|
+
| `react` ≥ 19 | everyone | |
|
|
205
|
+
| `react-native` ≥ 0.79 | native apps (optional) | web apps alias it to `react-native-web` instead |
|
|
206
|
+
| `react-native-web` ≥ 0.21 | web apps (optional) | |
|
|
207
|
+
| `react-native-svg` ≥ 15 | everyone | charts, gauge, dial (imported directly) |
|
|
208
|
+
| `react-native-vector-icons` ≥ 10 | native apps (optional) | default icons on native; the web draws the same glyphs from the fonts |
|
|
209
|
+
| `@react-native-community/datetimepicker` ≥ 8 | native apps (optional) | only `DateField.native.tsx`; the web date field is a text input |
|
|
210
|
+
| `@react-native-community/slider` ≥ 5 | native apps (optional) | only `SliderField.native.tsx`; the web slider is the browser's range input |
|
|
211
|
+
|
|
212
|
+
The wallet's bundler (Metro) builds from the TypeScript source (`react-native`
|
|
213
|
+
export condition); other bundlers use `build/module`. Web bundlers must resolve
|
|
214
|
+
`.web.*` files first, alias `react-native` to `react-native-web`, and point
|
|
215
|
+
`react-native-svg` at its web entry (see `vitest.config.ts`).
|
|
216
|
+
|
|
217
|
+
Run `pnpm --filter @veridid/workflow-ui check:web` to bundle the package like
|
|
218
|
+
a web app and check every type registers with no native-only module inside.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
// Screen-wide registry for "every title on this screen must render at the
|
|
6
|
+
// same font size" (and similarly for other synced text kinds in future).
|
|
7
|
+
// Each sibling group (e.g. one carousel's card/tile titles) registers the
|
|
8
|
+
// smallest scale IT needs to avoid clipping; the screen-wide scale exposed to
|
|
9
|
+
// every WorkflowText is the minimum across all registered groups, so a tight
|
|
10
|
+
// carousel in one section still keeps titles consistent with every other
|
|
11
|
+
// section on the same screen.
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const DEFAULT_VALUE = {
|
|
14
|
+
titleScale: 1,
|
|
15
|
+
registerTitleGroupScale: () => {},
|
|
16
|
+
unregisterTitleGroupScale: () => {}
|
|
17
|
+
};
|
|
18
|
+
const WorkflowFontScaleReactContext = /*#__PURE__*/createContext(DEFAULT_VALUE);
|
|
19
|
+
export const WorkflowFontScaleProvider = ({
|
|
20
|
+
children
|
|
21
|
+
}) => {
|
|
22
|
+
const scalesRef = useRef(new Map());
|
|
23
|
+
const [titleScale, setTitleScale] = useState(1);
|
|
24
|
+
const recompute = useCallback(() => {
|
|
25
|
+
const values = Array.from(scalesRef.current.values());
|
|
26
|
+
setTitleScale(values.length > 0 ? Math.min(...values) : 1);
|
|
27
|
+
}, []);
|
|
28
|
+
const registerTitleGroupScale = useCallback((id, scale) => {
|
|
29
|
+
if (scalesRef.current.get(id) === scale) return;
|
|
30
|
+
scalesRef.current.set(id, scale);
|
|
31
|
+
recompute();
|
|
32
|
+
}, [recompute]);
|
|
33
|
+
const unregisterTitleGroupScale = useCallback(id => {
|
|
34
|
+
if (!scalesRef.current.has(id)) return;
|
|
35
|
+
scalesRef.current.delete(id);
|
|
36
|
+
recompute();
|
|
37
|
+
}, [recompute]);
|
|
38
|
+
const value = useMemo(() => ({
|
|
39
|
+
titleScale,
|
|
40
|
+
registerTitleGroupScale,
|
|
41
|
+
unregisterTitleGroupScale
|
|
42
|
+
}), [titleScale, registerTitleGroupScale, unregisterTitleGroupScale]);
|
|
43
|
+
return /*#__PURE__*/_jsx(WorkflowFontScaleReactContext.Provider, {
|
|
44
|
+
value: value,
|
|
45
|
+
children: children
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Read the current screen-wide title scale (1 outside any provider).
|
|
50
|
+
export function useWorkflowTitleScale() {
|
|
51
|
+
return useContext(WorkflowFontScaleReactContext).titleScale;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Report the smallest scale a sibling group (e.g. one carousel) needs so its
|
|
55
|
+
// own titles fit on one line. `id` must be stable for the group's lifetime;
|
|
56
|
+
// `scale` may change across renders (e.g. once the carousel measures width).
|
|
57
|
+
export function useRegisterTitleGroupScale(id, scale) {
|
|
58
|
+
const {
|
|
59
|
+
registerTitleGroupScale,
|
|
60
|
+
unregisterTitleGroupScale
|
|
61
|
+
} = useContext(WorkflowFontScaleReactContext);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
registerTitleGroupScale(id, scale);
|
|
64
|
+
return () => unregisterTitleGroupScale(id);
|
|
65
|
+
}, [id, scale, registerTitleGroupScale, unregisterTitleGroupScale]);
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=WorkflowFontScaleContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","jsx","_jsx","DEFAULT_VALUE","titleScale","registerTitleGroupScale","unregisterTitleGroupScale","WorkflowFontScaleReactContext","WorkflowFontScaleProvider","children","scalesRef","Map","setTitleScale","recompute","values","Array","from","current","length","Math","min","id","scale","get","set","has","delete","value","Provider","useWorkflowTitleScale","useRegisterTitleGroupScale"],"sourceRoot":"../../src","sources":["WorkflowFontScaleContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;;AAE3G;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOA,MAAMC,aAA4C,GAAG;EACnDC,UAAU,EAAE,CAAC;EACbC,uBAAuB,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjCC,yBAAyB,EAAEA,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C,CAAC,EAC1E,CAACF,UAAU,EAAEC,uBAAuB,EAAEC,yBAAyB,CACjE,CAAC;EAED,oBAAOJ,IAAA,CAACK,6BAA6B,CAACqB,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAlB,QAAA,EAAEA;EAAQ,CAAyC,CAAC;AAClH,CAAC;;AAED;AACA,OAAO,SAASoB,qBAAqBA,CAAA,EAAW;EAC9C,OAAOjC,UAAU,CAACW,6BAA6B,CAAC,CAACH,UAAU;AAC7D;;AAEA;AACA;AACA;AACA,OAAO,SAAS0B,0BAA0BA,CAACT,EAAU,EAAEC,KAAa,EAAQ;EAC1E,MAAM;IAAEjB,uBAAuB;IAAEC;EAA0B,CAAC,GAAGV,UAAU,CAACW,6BAA6B,CAAC;EAExGV,SAAS,CAAC,MAAM;IACdQ,uBAAuB,CAACgB,EAAE,EAAEC,KAAK,CAAC;IAClC,OAAO,MAAMhB,yBAAyB,CAACe,EAAE,CAAC;EAC5C,CAAC,EAAE,CAACA,EAAE,EAAEC,KAAK,EAAEjB,uBAAuB,EAAEC,yBAAyB,CAAC,CAAC;AACrE","ignoreList":[]}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useSyncExternalStore } from 'react';
|
|
4
|
+
import { Linking, Platform } from 'react-native';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a credential or proof exchange stands, from the holder's side.
|
|
8
|
+
* Credential: offer received → `pending`; credential received / done →
|
|
9
|
+
* `success`. Proof: request received → `pending`; presentation sent / done →
|
|
10
|
+
* `success`. Declined → `declined`; abandoned / problem report → `failed`.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Everything a workflow control needs from the app around it: device features,
|
|
15
|
+
* links, messages and DIDComm exchanges. The wallet implements it with its
|
|
16
|
+
* native modules, credo agent and navigation; the designer uses
|
|
17
|
+
* {@link createSimulatedWalletAdapter}. Shared controls never import a native
|
|
18
|
+
* module or credo directly.
|
|
19
|
+
*
|
|
20
|
+
* Members named `use…` are React hooks. Keep the adapter object stable (create
|
|
21
|
+
* it once) so they are called in the same order on every render.
|
|
22
|
+
*/
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
/** A small grey image with a camera outline, used as the simulated photo. */
|
|
25
|
+
export const SIMULATED_PHOTO_URI = 'data:image/svg+xml;utf8,' + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="200" viewBox="0 0 320 200"><rect width="320" height="200" fill="#3A4A48"/><rect x="120" y="70" width="80" height="60" rx="8" fill="none" stroke="#C9D6D4" stroke-width="5"/><circle cx="160" cy="100" r="16" fill="none" stroke="#C9D6D4" stroke-width="5"/></svg>');
|
|
26
|
+
|
|
27
|
+
/** Wilmington, NC: the wallet's map fallback. */
|
|
28
|
+
export const SIMULATED_LOCATION = {
|
|
29
|
+
latitude: 34.240546,
|
|
30
|
+
longitude: -77.948781
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Stand-in adapter for the designer (and for any host that renders without
|
|
35
|
+
* one). Device calls resolve with sample data; an exchange the control waits
|
|
36
|
+
* for arrives after a short delay and completes when accepted.
|
|
37
|
+
*/
|
|
38
|
+
export function createSimulatedWalletAdapter(options = {}) {
|
|
39
|
+
const delay = options.exchangeDelayMs ?? 400;
|
|
40
|
+
const log = (action, detail) => options.onEvent?.({
|
|
41
|
+
action,
|
|
42
|
+
detail
|
|
43
|
+
});
|
|
44
|
+
const records = {
|
|
45
|
+
credential: [],
|
|
46
|
+
proof: []
|
|
47
|
+
};
|
|
48
|
+
const listeners = new Set();
|
|
49
|
+
let counter = 0;
|
|
50
|
+
const update = (kind, id, status) => {
|
|
51
|
+
records[kind] = records[kind].map(r => r.id === id ? {
|
|
52
|
+
...r,
|
|
53
|
+
status
|
|
54
|
+
} : r);
|
|
55
|
+
for (const l of listeners) l();
|
|
56
|
+
};
|
|
57
|
+
const subscribe = listener => {
|
|
58
|
+
listeners.add(listener);
|
|
59
|
+
return () => listeners.delete(listener);
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
simulated: true,
|
|
63
|
+
openUrl: async url => {
|
|
64
|
+
log('openUrl', url);
|
|
65
|
+
await Linking.openURL(url);
|
|
66
|
+
},
|
|
67
|
+
alert: (title, message) => options.onAlert ? options.onAlert(title, message) : log('alert', {
|
|
68
|
+
title,
|
|
69
|
+
message
|
|
70
|
+
}),
|
|
71
|
+
capturePhoto: async () => {
|
|
72
|
+
log('capturePhoto');
|
|
73
|
+
return {
|
|
74
|
+
uri: options.photoUri ?? SIMULATED_PHOTO_URI
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
scanBarcode: async () => {
|
|
78
|
+
log('scanBarcode');
|
|
79
|
+
return options.barcode ?? 'SIMULATED-QR-CODE';
|
|
80
|
+
},
|
|
81
|
+
getLocation: async () => {
|
|
82
|
+
log('getLocation');
|
|
83
|
+
return options.location ?? SIMULATED_LOCATION;
|
|
84
|
+
},
|
|
85
|
+
share: async request => log('share', request),
|
|
86
|
+
exportPdf: async request => {
|
|
87
|
+
log('exportPdf', {
|
|
88
|
+
fileName: request.fileName
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
uri: `simulated://${request.fileName}.pdf`
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
addCalendarEvent: async event => {
|
|
95
|
+
log('addCalendarEvent', event);
|
|
96
|
+
return true;
|
|
97
|
+
},
|
|
98
|
+
useExchanges: kind => useSyncExternalStore(subscribe, () => records[kind], () => records[kind]),
|
|
99
|
+
acceptExchange: async (kind, id) => {
|
|
100
|
+
log('acceptExchange', {
|
|
101
|
+
kind,
|
|
102
|
+
id
|
|
103
|
+
});
|
|
104
|
+
setTimeout(() => update(kind, id, 'success'), delay);
|
|
105
|
+
},
|
|
106
|
+
declineExchange: async (kind, id) => {
|
|
107
|
+
log('declineExchange', {
|
|
108
|
+
kind,
|
|
109
|
+
id
|
|
110
|
+
});
|
|
111
|
+
update(kind, id, 'declined');
|
|
112
|
+
},
|
|
113
|
+
expectExchange: (kind, connectionId) => {
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
counter += 1;
|
|
116
|
+
records[kind] = [...records[kind], {
|
|
117
|
+
id: `simulated-${kind}-${counter}`,
|
|
118
|
+
connectionId,
|
|
119
|
+
createdAt: Date.now(),
|
|
120
|
+
status: 'pending'
|
|
121
|
+
}];
|
|
122
|
+
for (const l of listeners) l();
|
|
123
|
+
}, delay);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const defaultAdapter = createSimulatedWalletAdapter();
|
|
128
|
+
let warnedNoAdapter = false;
|
|
129
|
+
const WalletAdapterContext = /*#__PURE__*/createContext(null);
|
|
130
|
+
/** The app's adapter for every control below it. Create the adapter once (stable identity). */
|
|
131
|
+
export function WalletAdapterProvider({
|
|
132
|
+
adapter,
|
|
133
|
+
children
|
|
134
|
+
}) {
|
|
135
|
+
return /*#__PURE__*/_jsx(WalletAdapterContext.Provider, {
|
|
136
|
+
value: adapter,
|
|
137
|
+
children: children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The nearest adapter; the simulated one when the host provides none. */
|
|
142
|
+
export function useWalletAdapter() {
|
|
143
|
+
const adapter = useContext(WalletAdapterContext);
|
|
144
|
+
if (adapter) return adapter;
|
|
145
|
+
if (Platform.OS !== 'web' && !warnedNoAdapter && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
146
|
+
warnedNoAdapter = true;
|
|
147
|
+
// biome-ignore lint/suspicious/noConsole: developer warning — device controls are simulated without the app's adapter
|
|
148
|
+
console.warn('[workflow-ui] No WalletAdapterProvider: device and credential controls are simulated.');
|
|
149
|
+
}
|
|
150
|
+
return defaultAdapter;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=WalletAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useSyncExternalStore","Linking","Platform","jsx","_jsx","SIMULATED_PHOTO_URI","encodeURIComponent","SIMULATED_LOCATION","latitude","longitude","createSimulatedWalletAdapter","options","delay","exchangeDelayMs","log","action","detail","onEvent","records","credential","proof","listeners","Set","counter","update","kind","id","status","map","r","l","subscribe","listener","add","delete","simulated","openUrl","url","openURL","alert","title","message","onAlert","capturePhoto","uri","photoUri","scanBarcode","barcode","getLocation","location","share","request","exportPdf","fileName","addCalendarEvent","event","useExchanges","acceptExchange","setTimeout","declineExchange","expectExchange","connectionId","createdAt","Date","now","defaultAdapter","warnedNoAdapter","WalletAdapterContext","WalletAdapterProvider","adapter","children","Provider","value","useWalletAdapter","OS","__DEV__","console","warn"],"sourceRoot":"../../../src","sources":["adapter/WalletAdapter.tsx"],"mappings":";;AAAA,SAA6BA,aAAa,EAAkBC,UAAU,EAAEC,oBAAoB,QAAQ,OAAO;AAC3G,SAASC,OAAO,EAAEC,QAAQ,QAAwC,cAAc;;AAIhF;AACA;AACA;AACA;AACA;AACA;;AA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA;AA8DA;AACA,OAAO,MAAMC,mBAAmB,GAC9B,0BAA0B,GAC1BC,kBAAkB,CAChB,gUACF,CAAC;;AAEH;AACA,OAAO,MAAMC,kBAA+B,GAAG;EAAEC,QAAQ,EAAE,SAAS;EAAEC,SAAS,EAAE,CAAC;AAAU,CAAC;;AAE7F;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAACC,OAA+B,GAAG,CAAC,CAAC,EAAiB;EAChG,MAAMC,KAAK,GAAGD,OAAO,CAACE,eAAe,IAAI,GAAG;EAC5C,MAAMC,GAAG,GAAGA,CAACC,MAAc,EAAEC,MAAgB,KAAKL,OAAO,CAACM,OAAO,GAAG;IAAEF,MAAM;IAAEC;EAAO,CAAC,CAAC;EACvF,MAAME,OAA+C,GAAG;IAAE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