@veridid/workflow-ui 0.0.0-stage → 0.1.0
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 +202 -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 +107 -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/WorkflowIcon.js +50 -0
- package/build/module/icons/WorkflowIcon.js.map +1 -0
- package/build/module/imageUriCache.js +25 -0
- package/build/module/imageUriCache.js.map +1 -0
- package/build/module/index.js +49 -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/WorkflowIcon.d.ts +27 -0
- package/build/typescript/icons/WorkflowIcon.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 +47 -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 +101 -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/WorkflowIcon.tsx +43 -0
- package/src/imageUriCache.ts +27 -0
- package/src/index.ts +96 -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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { FormFieldRegistry } from "../registries/FormFieldRegistry.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Web version of the slider: the browser's own range input. The community
|
|
9
|
+
* slider ships CommonJS that pulls a second copy of react-native-web into web
|
|
10
|
+
* bundles (~400 kB). Same behaviour as the native field: the label follows the
|
|
11
|
+
* thumb live, and the value is committed when the user lets go.
|
|
12
|
+
*/
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const SliderField = ({
|
|
15
|
+
field,
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
colors
|
|
19
|
+
}) => {
|
|
20
|
+
const min = field.min ?? 0;
|
|
21
|
+
const max = field.max ?? 100;
|
|
22
|
+
const toNum = v => {
|
|
23
|
+
const n = typeof v === 'string' ? Number.parseFloat(v) : v;
|
|
24
|
+
return Number.isFinite(n) ? n : min;
|
|
25
|
+
};
|
|
26
|
+
const [display, setDisplay] = React.useState(toNum(value));
|
|
27
|
+
|
|
28
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: sync the live label only when the committed value changes
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
setDisplay(toNum(value));
|
|
31
|
+
}, [value]);
|
|
32
|
+
const commit = () => onChange(Math.round(display).toString());
|
|
33
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
34
|
+
style: s.wrap,
|
|
35
|
+
children: [!!field.label && /*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: [s.label, {
|
|
37
|
+
color: colors.text
|
|
38
|
+
}],
|
|
39
|
+
children: field.label
|
|
40
|
+
}), /*#__PURE__*/React.createElement('input', {
|
|
41
|
+
type: 'range',
|
|
42
|
+
min,
|
|
43
|
+
max,
|
|
44
|
+
step: 1,
|
|
45
|
+
value: display,
|
|
46
|
+
'aria-label': field.label || 'Slider',
|
|
47
|
+
style: {
|
|
48
|
+
width: '100%',
|
|
49
|
+
height: 40,
|
|
50
|
+
accentColor: colors.primary
|
|
51
|
+
},
|
|
52
|
+
onChange: event => setDisplay(Number(event.target.value)),
|
|
53
|
+
onPointerUp: commit,
|
|
54
|
+
onKeyUp: commit,
|
|
55
|
+
onBlur: commit
|
|
56
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
57
|
+
style: [s.value, {
|
|
58
|
+
color: colors.primary
|
|
59
|
+
}],
|
|
60
|
+
children: Math.round(display)
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const s = StyleSheet.create({
|
|
65
|
+
wrap: {
|
|
66
|
+
marginBottom: 8
|
|
67
|
+
},
|
|
68
|
+
label: {
|
|
69
|
+
fontSize: 14,
|
|
70
|
+
fontWeight: '600',
|
|
71
|
+
marginBottom: 4
|
|
72
|
+
},
|
|
73
|
+
value: {
|
|
74
|
+
fontSize: 16,
|
|
75
|
+
fontWeight: '700',
|
|
76
|
+
textAlign: 'center',
|
|
77
|
+
marginTop: 2
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
FormFieldRegistry.register('slider', SliderField);
|
|
81
|
+
export default SliderField;
|
|
82
|
+
//# sourceMappingURL=SliderField.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","View","FormFieldRegistry","jsx","_jsx","jsxs","_jsxs","SliderField","field","value","onChange","colors","min","max","toNum","v","n","Number","parseFloat","isFinite","display","setDisplay","useState","useEffect","commit","Math","round","toString","style","s","wrap","children","label","color","text","createElement","type","step","width","height","accentColor","primary","event","target","onPointerUp","onKeyUp","onBlur","create","marginBottom","fontSize","fontWeight","textAlign","marginTop","register"],"sourceRoot":"../../../src","sources":["form-fields/SliderField.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAA8BC,iBAAiB,QAAQ,oCAAiC;;AAExF;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMA,MAAMC,WAAqC,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAK;EACpF,MAAMC,GAAG,GAAGJ,KAAK,CAACI,GAAG,IAAI,CAAC;EAC1B,MAAMC,GAAG,GAAGL,KAAK,CAACK,GAAG,IAAI,GAAG;EAE5B,MAAMC,KAAK,GAAIC,CAAU,IAAa;IACpC,MAAMC,CAAC,GAAG,OAAOD,CAAC,KAAK,QAAQ,GAAGE,MAAM,CAACC,UAAU,CAACH,CAAC,CAAC,GAAIA,CAAY;IACtE,OAAOE,MAAM,CAACE,QAAQ,CAACH,CAAC,CAAC,GAAGA,CAAC,GAAGJ,GAAG;EACrC,CAAC;EAED,MAAM,CAACQ,OAAO,EAAEC,UAAU,CAAC,GAAGvB,KAAK,CAACwB,QAAQ,CAASR,KAAK,CAACL,KAAK,CAAC,CAAC;;EAElE;EACAX,KAAK,CAACyB,SAAS,CAAC,MAAM;IACpBF,UAAU,CAACP,KAAK,CAACL,KAAK,CAAC,CAAC;EAC1B,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,MAAMe,MAAM,GAAGA,CAAA,KA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AEkB,YAAY,EAAE;EAAE,CAAC;EACzBhB,KAAK,EAAE;IAAEiB,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,KAAK;IAAEF,YAAY,EAAE;EAAE,CAAC;EAC3DvC,KAAK,EAAE;IAAEwC,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,KAAK;IAAEC,SAAS,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAE;AAC9E,CAAC,CAAC;AAEFlD,iBAAiB,CAACmD,QAAQ,CAAC,QAAQ,EAAE9C,WAAW,CAAC;AAEjD,eAAeA,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-console */
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { TouchableOpacity } from 'react-native';
|
|
7
|
+
import WorkflowButtonLabel from "../components/WorkflowButtonLabel.js";
|
|
8
|
+
import { useWorkflowT } from "../i18n/WorkflowI18n.js";
|
|
9
|
+
import { FormFieldRegistry } from "../registries/FormFieldRegistry.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const SubmitButtonField = ({
|
|
12
|
+
field,
|
|
13
|
+
onChange,
|
|
14
|
+
styles,
|
|
15
|
+
colors,
|
|
16
|
+
groupFontScale = 1
|
|
17
|
+
}) => {
|
|
18
|
+
const t = useWorkflowT();
|
|
19
|
+
const handlePress = () => {
|
|
20
|
+
// Trigger onChange which will be caught by ActionMenuBubble
|
|
21
|
+
if (onChange) {
|
|
22
|
+
onChange('submit');
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
26
|
+
style: [styles.button, {
|
|
27
|
+
backgroundColor: colors.primary,
|
|
28
|
+
borderColor: colors.primary,
|
|
29
|
+
marginTop: 8
|
|
30
|
+
}],
|
|
31
|
+
onPress: handlePress,
|
|
32
|
+
activeOpacity: 0.8,
|
|
33
|
+
children: /*#__PURE__*/_jsx(WorkflowButtonLabel, {
|
|
34
|
+
style: styles.buttonText,
|
|
35
|
+
groupFontScale: groupFontScale,
|
|
36
|
+
children: field.label || t('WorkflowUi.Submit')
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
FormFieldRegistry.register('submit-button', SubmitButtonField);
|
|
41
|
+
export default SubmitButtonField;
|
|
42
|
+
//# sourceMappingURL=SubmitButtonField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","TouchableOpacity","WorkflowButtonLabel","useWorkflowT","FormFieldRegistry","jsx","_jsx","SubmitButtonField","field","onChange","styles","colors","groupFontScale","t","handlePress","style","button","backgroundColor","primary","borderColor","marginTop","onPress","activeOpacity","children","buttonText","label","register"],"sourceRoot":"../../../src","sources":["form-fields/SubmitButtonField.tsx"],"mappings":";;AAAA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,OAAOC,mBAAmB,MAAM,sCAAmC;AACnE,SAASC,YAAY,QAAQ,yBAAsB;AACnD,SAA8BC,iBAAiB,QAAQ,oCAAiC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAExF,MAAMC,iBAA2C,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,MAAM;EAAEC,cAAc,GAAG;AAAE,CAAC,KAAK;EAC/G,MAAMC,CAAC,GAAGV,YAAY,CAAC,CAAC;EACxB,MAAMW,WAAW,GAAGA,CAAA,KAAM;IACxB;IACA,IAAIL,QAAQ,EAAE;MACZA,QAAQ,CAAC,QAAQ,CAAC;IACpB;EACF,CAAC;EAED,oBACEH,IAAA,CAACL,gBAAgB;IACfc,KAAK,EAAE,CAACL,MAAM,CAACM,MAAM,EAAE;MAAEC,eAAe,EAAEN,MAAM,CAACO,OAAO;MAAEC,WAAW,EAAER,MAAM,CAACO,OAAO;MAAEE,SAAS,EAAE;IAAE,CAAC,CAAE;IACvGC,OAAO,EAAEP,WAAY;IACrBQ,aAAa,EAAE,GAAI;IAAAC,QAAA,eAEnBjB,IAAA,CAACJ,mBAAmB;MAACa,KAAK,EAAEL,MAAM,CAACc,UAAW;MAACZ,cAAc,EAAEA,cAAe;MAAAW,QAAA,EAC3Ef,KAAK,CAACiB,KAAK,IAAIZ,CAAC,CAAC,mBAAmB;IAAC,CACnB;EAAC,CACN,CAAC;AAEvB,CAAC;AAEDT,iBAAiB,CAACsB,QAAQ,CAAC,eAAe,EAAEnB,iBAAiB,CAAC;AAE9D,eAAeA,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { TextInput, View } from 'react-native';
|
|
5
|
+
import WorkflowText from "../components/WorkflowText.js";
|
|
6
|
+
import { FormFieldRegistry } from "../registries/FormFieldRegistry.js";
|
|
7
|
+
import { testIdWithKey } from "../utils/testable.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const TextField = ({
|
|
10
|
+
field,
|
|
11
|
+
value,
|
|
12
|
+
onChange,
|
|
13
|
+
styles,
|
|
14
|
+
colors
|
|
15
|
+
}) => {
|
|
16
|
+
const isMultiline = field.type === 'text-area' || field.type === 'textarea';
|
|
17
|
+
const borderColor = colors.border || colors.primary || '#7EB8B8';
|
|
18
|
+
const backgroundColor = colors.background || 'rgba(255,255,255,0.08)';
|
|
19
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
20
|
+
style: styles.fieldContainer,
|
|
21
|
+
children: [/*#__PURE__*/_jsx(WorkflowText, {
|
|
22
|
+
variant: "label",
|
|
23
|
+
style: [styles.label, {
|
|
24
|
+
color: colors.text
|
|
25
|
+
}],
|
|
26
|
+
children: field.label
|
|
27
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
28
|
+
testID: testIdWithKey(`WorkflowTextInput-${field.name || 'field'}`),
|
|
29
|
+
accessibilityLabel: field.label || 'Text input',
|
|
30
|
+
style: [styles.input, {
|
|
31
|
+
borderWidth: 1.5,
|
|
32
|
+
borderColor,
|
|
33
|
+
color: colors.text,
|
|
34
|
+
backgroundColor
|
|
35
|
+
}, isMultiline ? {
|
|
36
|
+
minHeight: 80,
|
|
37
|
+
textAlignVertical: 'top'
|
|
38
|
+
} : null],
|
|
39
|
+
value: value || '',
|
|
40
|
+
onChangeText: onChange,
|
|
41
|
+
placeholder: field.placeholder,
|
|
42
|
+
placeholderTextColor: colors.border || '#9AA0A6',
|
|
43
|
+
multiline: isMultiline,
|
|
44
|
+
numberOfLines: isMultiline ? 3 : undefined,
|
|
45
|
+
editable: field.disabled !== true,
|
|
46
|
+
underlineColorAndroid: "transparent"
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
FormFieldRegistry.register('text', TextField);
|
|
51
|
+
FormFieldRegistry.register('text-field', TextField);
|
|
52
|
+
FormFieldRegistry.register('text-input', TextField);
|
|
53
|
+
FormFieldRegistry.register('textarea', TextField);
|
|
54
|
+
FormFieldRegistry.register('text-area', TextField);
|
|
55
|
+
export default TextField;
|
|
56
|
+
//# sourceMappingURL=TextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","TextInput","View","WorkflowText","FormFieldRegistry","testIdWithKey","jsx","_jsx","jsxs","_jsxs","TextField","field","value","onChange","styles","colors","isMultiline","type","borderColor","border","primary","backgroundColor","background","style","fieldContainer","children","variant","label","color","text","testID","name","accessibilityLabel","input","borderWidth","minHeight","textAlignVertical","onChangeText","placeholder","placeholderTextColor","multiline","numberOfLines","undefined","editable","disabled","underlineColorAndroid","register"],"sourceRoot":"../../../src","sources":["form-fields/TextField.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,OAAOC,YAAY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ACnByB,YAAY,EAAExB,QAAS;MACvByB,WAAW,EAAE3B,KAAK,CAAC2B,WAAY;MAC/BC,oBAAoB,EAAExB,MAAM,CAACI,MAAM,IAAI,SAAU;MACjDqB,SAAS,EAAExB,WAAY;MACvByB,aAAa,EAAEzB,WAAW,GAAG,CAAC,GAAG0B,SAAU;MAC3CC,QAAQ,EAAEhC,KAAK,CAACiC,QAAQ,KAAK,IAAK;MAClCC,qBAAqB,EAAC;IAAa,CACpC,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAEDzC,iBAAiB,CAAC0C,QAAQ,CAAC,MAAM,EAAEpC,SAAS,CAAC;AAC7CN,iBAAiB,CAAC0C,QAAQ,CAAC,YAAY,EAAEpC,SAAS,CAAC;AACnDN,iBAAiB,CAAC0C,QAAQ,CAAC,YAAY,EAAEpC,SAAS,CAAC;AACnDN,iBAAiB,CAAC0C,QAAQ,CAAC,UAAU,EAAEpC,SAAS,CAAC;AACjDN,iBAAiB,CAAC0C,QAAQ,CAAC,WAAW,EAAEpC,SAAS,CAAC;AAElD,eAAeA,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Registers the form-field renderers with FormFieldRegistry.
|
|
5
|
+
* Imported for its side effects by the package entry point.
|
|
6
|
+
*/
|
|
7
|
+
import "./TextField.js";
|
|
8
|
+
import "./CheckboxField.js";
|
|
9
|
+
import "./RadioField.js";
|
|
10
|
+
import "./MCQField.js";
|
|
11
|
+
import './DateField';
|
|
12
|
+
import './SliderField';
|
|
13
|
+
import "./DropdownField.js";
|
|
14
|
+
import "./SubmitButtonField.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["form-fields/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,gBAAa;AACpB,OAAO,oBAAiB;AACxB,OAAO,iBAAc;AACrB,OAAO,eAAY;AACnB,OAAO,aAAa;AACpB,OAAO,eAAe;AACtB,OAAO,oBAAiB;AACxB,OAAO,wBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useCallback, useContext } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* English text for every string the workflow controls show. Keys match the
|
|
7
|
+
* wallet's i18n keys (`Workflow.*`, `Global.*`), so the wallet can pass its own
|
|
8
|
+
* translate function straight through; new keys use the `WorkflowUi.*` prefix.
|
|
9
|
+
*/
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export const DEFAULT_WORKFLOW_STRINGS = {
|
|
12
|
+
'Global.Decline': 'Decline',
|
|
13
|
+
'Workflow.CredentialOffer': 'Credential offer',
|
|
14
|
+
'Workflow.ProofRequest': 'Proof request',
|
|
15
|
+
'Workflow.AcceptCredential': 'Accept credential',
|
|
16
|
+
'Workflow.PresentProof': 'Present proof',
|
|
17
|
+
'Workflow.WaitingForOffer': 'Waiting for the credential offer…',
|
|
18
|
+
'Workflow.ReceivingCredential': 'Receiving credential…',
|
|
19
|
+
'Workflow.CredentialReceived': 'Credential received',
|
|
20
|
+
'Workflow.OfferDeclined': 'Offer declined',
|
|
21
|
+
'Workflow.OfferFailed': 'Something went wrong receiving the credential',
|
|
22
|
+
'Workflow.WaitingForProofRequest': 'Waiting for the proof request…',
|
|
23
|
+
'Workflow.PresentingProof': 'Presenting proof…',
|
|
24
|
+
'Workflow.ProofPresented': 'Proof presented',
|
|
25
|
+
'Workflow.ProofDeclined': 'Proof request declined',
|
|
26
|
+
'Workflow.ProofFailed': 'Something went wrong presenting the proof',
|
|
27
|
+
'WorkflowUi.Select': 'Select...',
|
|
28
|
+
'WorkflowUi.SelectDate': 'Select date...',
|
|
29
|
+
'WorkflowUi.Submit': 'Submit',
|
|
30
|
+
'WorkflowUi.Done': 'Done',
|
|
31
|
+
'WorkflowUi.Error': 'Error',
|
|
32
|
+
'WorkflowUi.InvalidLink': 'Invalid link',
|
|
33
|
+
'WorkflowUi.InvalidLinkMessage': 'Only http(s) links are supported.',
|
|
34
|
+
'WorkflowUi.LinkFailed': 'Unable to open link',
|
|
35
|
+
'WorkflowUi.TakePhoto': 'Take a photo',
|
|
36
|
+
'WorkflowUi.Retake': 'Retake',
|
|
37
|
+
'WorkflowUi.PhotoFailed': 'Failed to take photo. Please try again.',
|
|
38
|
+
'WorkflowUi.ScanCode': 'Scan QR code',
|
|
39
|
+
'WorkflowUi.ShareLocation': 'Share location',
|
|
40
|
+
'WorkflowUi.LocationUnavailable': 'Location unavailable',
|
|
41
|
+
'WorkflowUi.LocationUnavailableMessage': 'Could not get your current GPS position. Turn on Location / GPS and try again.',
|
|
42
|
+
'WorkflowUi.MyLocation': 'My location coordinates:',
|
|
43
|
+
'WorkflowUi.Share': 'Share',
|
|
44
|
+
'WorkflowUi.ShareFailed': 'Failed to share content',
|
|
45
|
+
'WorkflowUi.ReportTitle': 'DigiCred Wallet Report',
|
|
46
|
+
'WorkflowUi.Responses': 'Responses:',
|
|
47
|
+
'WorkflowUi.NoData': 'No data entered yet.',
|
|
48
|
+
'WorkflowUi.AddToCalendar': 'Add to Calendar',
|
|
49
|
+
'WorkflowUi.InvalidDate': 'Invalid date',
|
|
50
|
+
'WorkflowUi.InvalidDateMessage': 'This event is missing a valid start or end time.',
|
|
51
|
+
'WorkflowUi.CalendarAdded': 'Event added to your calendar!',
|
|
52
|
+
'WorkflowUi.CalendarFailed': 'Failed to add event to calendar.',
|
|
53
|
+
'WorkflowUi.Event': 'Event',
|
|
54
|
+
'WorkflowUi.Location': 'Location',
|
|
55
|
+
'WorkflowUi.OpenInMaps': 'Tap to open in Maps',
|
|
56
|
+
'WorkflowUi.VideoFailed': 'Failed to load video',
|
|
57
|
+
'WorkflowUi.Simulated': 'Simulated on the web',
|
|
58
|
+
'WorkflowUi.OpenBadge': 'Open badge',
|
|
59
|
+
'WorkflowUi.OpenBadgeDescription': 'Preview of the badge signed onto this artifact. Tap {{label}} to accept and store it.',
|
|
60
|
+
'WorkflowUi.AddToWallet': 'Add to Wallet'
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns the text for `key`. `defaultValue` is the English text; `params`
|
|
65
|
+
* fill `{{name}}` placeholders. Same shape as i18next's `t(key, { defaultValue, ...params })`.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
const fill = (text, params) => params ? text.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, name) => name in params ? String(params[name]) : match) : text;
|
|
69
|
+
const englishTranslate = (_key, defaultValue, params) => fill(defaultValue, params);
|
|
70
|
+
const WorkflowI18nContext = /*#__PURE__*/createContext(englishTranslate);
|
|
71
|
+
/**
|
|
72
|
+
* Supplies translations for the workflow controls. Without it they show
|
|
73
|
+
* English. Wallet: `translate={(key, defaultValue, params) => t(key, { defaultValue, ...params })}`.
|
|
74
|
+
*/
|
|
75
|
+
export function WorkflowI18nProvider({
|
|
76
|
+
translate,
|
|
77
|
+
children
|
|
78
|
+
}) {
|
|
79
|
+
return /*#__PURE__*/_jsx(WorkflowI18nContext.Provider, {
|
|
80
|
+
value: translate,
|
|
81
|
+
children: children
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** `t('Global.Decline')` returns the translated text, falling back to English. */
|
|
86
|
+
export function useWorkflowT() {
|
|
87
|
+
const translate = useContext(WorkflowI18nContext);
|
|
88
|
+
return useCallback((key, params) => {
|
|
89
|
+
const text = translate(key, DEFAULT_WORKFLOW_STRINGS[key], params);
|
|
90
|
+
// A translate function that does not know the key may return the key itself.
|
|
91
|
+
return text && text !== key ? fill(text, params) : fill(DEFAULT_WORKFLOW_STRINGS[key], params);
|
|
92
|
+
}, [translate]);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=WorkflowI18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useCallback","useContext","jsx","_jsx","DEFAULT_WORKFLOW_STRINGS","fill","text","params","replace","match","name","String","englishTranslate","_key","defaultValue","WorkflowI18nContext","WorkflowI18nProvider","translate","children","Provider","value","useWorkflowT","key"],"sourceRoot":"../../../src","sources":["i18n/WorkflowI18n.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAkBC,WAAW,EAAEC,UAAU,QAAQ,OAAO;;AAE9E;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,MAAMC,wBAAwB,GAAG;EACtC,gBAAgB,EAAE,SAAS;EAC3B,0BAA0B,EAAE,kBAAkB;EAC9C,uBAAuB,EAAE,eAAe;EACxC,2BAA2B,EAAE,mBAAmB;EAChD,uBAAuB,EAAE,eAAe;EACxC,0BAA0B,EAAE,mCAAmC;EAC/D,8BAA8B,EAAE,uBAAuB;EACvD,6BAA6B,EAAE,qBAAqB;EACpD,wBAAwB,EAAE,gBAAgB;EAC1C,sBAAsB,EAAE,+CAA+C;EACvE,iCAAiC,EAAE,gCAAgC;EACnE,0BAA0B,EAAE,mBAAmB;EAC/C,yBAAyB,EAAE,iBAAiB;EAC5C,wBAAwB,EAAE,wBAAwB;EAClD,sBAAsB,EAAE,2CAA2C;EACnE,mBAAmB,EAAE,WAAW;EAChC,uBAAuB,EAAE,gBAAgB;EACzC,mBAAmB,EAAE,QAAQ;EAC7B,iBAAiB,EAAE,MAAM;EACzB,kBAAkB,EAAE,OAAO;EAC3B,wBAAwB,EAAE,cAAc;EACxC,+BAA+B,EAAE,mCAAmC;EACpE,uBAAuB,EAAE,qBAAqB;EAC9C,sBAAsB,EAAE,cAAc;EACtC,mBAAmB,EAAE,QAAQ;EAC7B,wBAAwB,EAAE,yCAAyC;EACnE,qBAAqB,EAAE,cAAc;EACrC,0BAA0B,EAAE,gBAAgB;EAC5C,gCAAgC,EAAE,sBAAsB;EACxD,uCAAuC,EACrC,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O,SAASG,YAAYA,CAAA,EAAiF;EAC3G,MAAMJ,SAAS,GAAGhB,UAAU,CAACc,mBAAmB,CAAC;EACjD,OAAOf,WAAW,CAChB,CAACsB,GAAsB,EAAEf,MAAwC,KAAK;IACpE,MAAMD,IAAI,GAAGW,SAAS,CAACK,GAAG,EAAElB,wBAAwB,CAACkB,GAAG,CAAC,EAAEf,MAAM,CAAC;IAClE;IACA,OAAOD,IAAI,IAAIA,IAAI,KAAKgB,GAAG,GAAGjB,IAAI,CAACC,IAAI,EAAEC,MAAM,CAAC,GAAGF,IAAI,CAACD,wBAAwB,CAACkB,GAAG,CAAC,EAAEf,MAAM,CAAC;EAChG,CAAC,EACD,CAACU,SAAS,CACZ,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
5
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
6
|
+
|
|
7
|
+
/** Icon families the controls use (names are the vector-icons names). */
|
|
8
|
+
|
|
9
|
+
/** Draws one icon. Return `null` to fall back to the built-in vector icons. */
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
const WorkflowIconContext = /*#__PURE__*/createContext(null);
|
|
12
|
+
/**
|
|
13
|
+
* Replaces the icons every control draws (e.g. the designer can use its own
|
|
14
|
+
* icon set instead of loading the vector-icon fonts). Without it, controls use
|
|
15
|
+
* `react-native-vector-icons`, like the wallet.
|
|
16
|
+
*/
|
|
17
|
+
export function WorkflowIconProvider({
|
|
18
|
+
renderIcon,
|
|
19
|
+
children
|
|
20
|
+
}) {
|
|
21
|
+
return /*#__PURE__*/_jsx(WorkflowIconContext.Provider, {
|
|
22
|
+
value: renderIcon,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The one place controls draw icons. */
|
|
28
|
+
export function WorkflowIcon(props) {
|
|
29
|
+
const renderIcon = useContext(WorkflowIconContext);
|
|
30
|
+
const custom = renderIcon?.(props);
|
|
31
|
+
if (custom != null) return /*#__PURE__*/_jsx(_Fragment, {
|
|
32
|
+
children: custom
|
|
33
|
+
});
|
|
34
|
+
const {
|
|
35
|
+
set = 'material',
|
|
36
|
+
name,
|
|
37
|
+
size,
|
|
38
|
+
color,
|
|
39
|
+
style
|
|
40
|
+
} = props;
|
|
41
|
+
const Family = set === 'material-community' ? MaterialCommunityIcons : MaterialIcons;
|
|
42
|
+
// vector-icons' typings use the old @types/react-native StyleProp; same runtime shape.
|
|
43
|
+
return /*#__PURE__*/_jsx(Family, {
|
|
44
|
+
name: name,
|
|
45
|
+
size: size,
|
|
46
|
+
color: color,
|
|
47
|
+
style: style
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=WorkflowIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","MaterialCommunityIcons","MaterialIcons","jsx","_jsx","Fragment","_Fragment","WorkflowIconContext","WorkflowIconProvider","renderIcon","children","Provider","value","WorkflowIcon","props","custom","set","name","size","color","style","Family"],"sourceRoot":"../../../src","sources":["icons/WorkflowIcon.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAkBC,UAAU,QAAQ,OAAO;AAEjE,OAAOC,sBAAsB,MAAM,kDAAkD;AACrF,OAAOC,aAAa,MAAM,yCAAyC;;AAEnE;;AAYA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAGA,MAAMC,mBAAmB,gBAAGR,aAAa,CAA8B,IAAI,CAAC;AAI5E;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,oBAAoBA,CAAC;EAAEC,UAAU;EAAEC;AAAoC,CAAC,EAAE;EACxF,oBAAON,IAAA,CAACG,mBAAmB,CAACI,QAAQ;IAACC,KAAK,EAAEH,UAAW;IAAAC,QAAA,EAAEA;EAAQ,CAA+B,CAAC;AACnG;;AAEA;AACA,OAAO,SAASG,YAAYA,CAACC,KAAwB,EAAE;EACrD,MAAML,UAAU,GAAGT,UAAU,CAACO,mBAAmB,CAAC;EAClD,MAAMQ,MAAM,GAAGN,UAAU,GAAGK,KAAK,CAAC;EAClC,IAAIC,MAAM,IAAI,IAAI,EAAE,oBAAOX,IAAA,CAAAE,SAAA;IAAAI,QAAA,EAAGK;EAAM,CAAG,CAAC;EACxC,MAAM;IAAEC,GAAG,GAAG,UAAU;IAAEC,IAAI;IAAEC,IAAI;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGN,KAAK;EAC5D,MAAMO,MAAM,GAAGL,GAAG,KAAK,oBAAoB,GAAGf,sBAAsB,GAAGC,aAAa;EACpF;EACA,oBAAOE,IAAA,CAACiB,MAAM;IAACJ,IAAI,EAAEA,IAAK;IAACC,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACC,KAAK,EAAEA;EAAe,CAAE,CAAC;AAChF","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Deduped Image.prefetch for workflow tile/card URLs.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Image } from 'react-native';
|
|
8
|
+
const prefetched = new Set();
|
|
9
|
+
const inflight = new Set();
|
|
10
|
+
export function prefetchImageUri(uri) {
|
|
11
|
+
const trimmed = uri?.trim();
|
|
12
|
+
if (!trimmed || !trimmed.startsWith('http')) return;
|
|
13
|
+
if (prefetched.has(trimmed) || inflight.has(trimmed)) return;
|
|
14
|
+
inflight.add(trimmed);
|
|
15
|
+
void Image.prefetch(trimmed).then(() => {
|
|
16
|
+
prefetched.add(trimmed);
|
|
17
|
+
}).catch(() => {}).finally(() => inflight.delete(trimmed));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Test-only. */
|
|
21
|
+
export function clearImageUriCache() {
|
|
22
|
+
prefetched.clear();
|
|
23
|
+
inflight.clear();
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=imageUriCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","prefetched","Set","inflight","prefetchImageUri","uri","trimmed","trim","startsWith","has","add","prefetch","then","catch","finally","delete","clearImageUriCache","clear"],"sourceRoot":"../../src","sources":["imageUriCache.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,cAAc;AAEpC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAS,CAAC;AACpC,MAAMC,QAAQ,GAAG,IAAID,GAAG,CAAS,CAAC;AAElC,OAAO,SAASE,gBAAgBA,CAACC,GAAuB,EAAQ;EAC9D,MAAMC,OAAO,GAAGD,GAAG,EAAEE,IAAI,CAAC,CAAC;EAC3B,IAAI,CAACD,OAAO,IAAI,CAACA,OAAO,CAACE,UAAU,CAAC,MAAM,CAAC,EAAE;EAC7C,IAAIP,UAAU,CAACQ,GAAG,CAACH,OAAO,CAAC,IAAIH,QAAQ,CAACM,GAAG,CAACH,OAAO,CAAC,EAAE;EACtDH,QAAQ,CAACO,GAAG,CAACJ,OAAO,CAAC;EACrB,KAAKN,KAAK,CAACW,QAAQ,CAACL,OAAO,CAAC,CACzBM,IAAI,CAAC,MAAM;IACVX,UAAU,CAACS,GAAG,CAACJ,OAAO,CAAC;EACzB,CAAC,CAAC,CACDO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CACfC,OAAO,CAAC,MAAMX,QAAQ,CAACY,MAAM,CAACT,OAAO,CAAC,CAAC;AAC5C;;AAEA;AACA,OAAO,SAASU,kBAAkBA,CAAA,EAAS;EACzCf,UAAU,CAACgB,KAAK,CAAC,CAAC;EAClBd,QAAQ,CAACc,KAAK,CAAC,CAAC;AAClB","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @veridid/workflow-ui
|
|
5
|
+
*
|
|
6
|
+
* React Native components for workflow display hints. Written once with React
|
|
7
|
+
* Native primitives:
|
|
8
|
+
* - the DigiCred wallet renders them natively (Metro)
|
|
9
|
+
* - the CrMS designer renders them through react-native-web (Vite)
|
|
10
|
+
*
|
|
11
|
+
* The wallet is the reference renderer. Device-only controls (camera, barcode,
|
|
12
|
+
* location, …) get a `.web.tsx` placeholder and talk to the device through an
|
|
13
|
+
* adapter, never through a native module imported directly.
|
|
14
|
+
*/
|
|
15
|
+
export { CONTRACT_VERSION } from '@veridid/workflow-core';
|
|
16
|
+
// App providers: theme, translations, icons, device and credential access, popups
|
|
17
|
+
|
|
18
|
+
export { createSimulatedWalletAdapter, SIMULATED_LOCATION, SIMULATED_PHOTO_URI, useWalletAdapter, WalletAdapterProvider } from "./adapter/WalletAdapter.js";
|
|
19
|
+
export { default as WorkflowButtonLabel } from "./components/WorkflowButtonLabel.js";
|
|
20
|
+
// Building blocks for host-rendered controls
|
|
21
|
+
|
|
22
|
+
export { default as WorkflowText, WORKFLOW_TEXT_BASE_SIZES } from "./components/WorkflowText.js";
|
|
23
|
+
export { isFormFieldChild } from "./content/FormContent.js";
|
|
24
|
+
export { DEFAULT_WORKFLOW_STRINGS, useWorkflowT, WorkflowI18nProvider } from "./i18n/WorkflowI18n.js";
|
|
25
|
+
export { WorkflowIcon, WorkflowIconProvider } from "./icons/WorkflowIcon.js";
|
|
26
|
+
export { clearImageUriCache, prefetchImageUri } from "./imageUriCache.js";
|
|
27
|
+
export { useModalPosition, WorkflowModal, WorkflowModalHost } from "./modal/WorkflowModal.js";
|
|
28
|
+
export { platformName } from './platform/platformName';
|
|
29
|
+
export { clearControlSnapshots } from "./protocol/controlSnapshotStore.js";
|
|
30
|
+
// Registries: map a display-hint `type` to its renderer
|
|
31
|
+
|
|
32
|
+
export { ContentRegistry } from "./registries/ContentRegistry.js";
|
|
33
|
+
export { FormFieldRegistry } from "./registries/FormFieldRegistry.js";
|
|
34
|
+
// Rendering a screen: RenderTree + optional provider for expressions and designer hooks
|
|
35
|
+
|
|
36
|
+
export { deriveNode, resolveNode } from "./render/nodes.js";
|
|
37
|
+
export { RenderTree } from "./render/RenderTree.js";
|
|
38
|
+
export { WorkflowRenderProvider } from "./render/WorkflowRenderContext.js";
|
|
39
|
+
// Providers the host app wraps the workflow screen in
|
|
40
|
+
|
|
41
|
+
export { ResponsiveProvider, ResponsiveRule, useDigiCredStyles, useResponsive } from "./responsive/index.js";
|
|
42
|
+
export * from "./style/resolveDisplayHintStyle.js";
|
|
43
|
+
export { DEFAULT_WORKFLOW_THEME, mergeWorkflowTheme, useWorkflowTheme, WorkflowThemeProvider } from "./theme/WorkflowTheme.js";
|
|
44
|
+
export { useRegisterTitleGroupScale, useWorkflowTitleScale, WorkflowFontScaleProvider } from "./WorkflowFontScaleContext.js";
|
|
45
|
+
|
|
46
|
+
// Side effects: register the built-in form fields and content components.
|
|
47
|
+
import "./form-fields/index.js";
|
|
48
|
+
import "./content/index.js";
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CONTRACT_VERSION","createSimulatedWalletAdapter","SIMULATED_LOCATION","SIMULATED_PHOTO_URI","useWalletAdapter","WalletAdapterProvider","default","WorkflowButtonLabel","WorkflowText","WORKFLOW_TEXT_BASE_SIZES","isFormFieldChild","DEFAULT_WORKFLOW_STRINGS","useWorkflowT","WorkflowI18nProvider","WorkflowIcon","WorkflowIconProvider","clearImageUriCache","prefetchImageUri","useModalPosition","WorkflowModal","WorkflowModalHost","platformName","clearControlSnapshots","ContentRegistry","FormFieldRegistry","deriveNode","resolveNode","RenderTree","WorkflowRenderProvider","ResponsiveProvider","ResponsiveRule","useDigiCredStyles","useResponsive","DEFAULT_WORKFLOW_THEME","mergeWorkflowTheme","useWorkflowTheme","WorkflowThemeProvider","useRegisterTitleGro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,oBAAW","ignoreList":[]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Modal, StyleSheet, View } from 'react-native';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const ModalHostContext = /*#__PURE__*/createContext(null);
|
|
7
|
+
/**
|
|
8
|
+
* Optional. Popups (dropdown list, date sheet) of the controls inside open
|
|
9
|
+
* over this view instead of over the whole window. The designer wraps its
|
|
10
|
+
* phone frame in it, so a dropdown stays inside the phone and the rest of
|
|
11
|
+
* the designer remains usable. Put it outside any ScrollView.
|
|
12
|
+
*/
|
|
13
|
+
export function WorkflowModalHost({
|
|
14
|
+
children,
|
|
15
|
+
style
|
|
16
|
+
}) {
|
|
17
|
+
const [entries, setEntries] = useState([]);
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const api = useMemo(() => ({
|
|
20
|
+
show: (id, node) => setEntries(prev => {
|
|
21
|
+
const index = prev.findIndex(e => e.id === id);
|
|
22
|
+
if (index === -1) return [...prev, {
|
|
23
|
+
id,
|
|
24
|
+
node
|
|
25
|
+
}];
|
|
26
|
+
const next = prev.slice();
|
|
27
|
+
next[index] = {
|
|
28
|
+
id,
|
|
29
|
+
node
|
|
30
|
+
};
|
|
31
|
+
return next;
|
|
32
|
+
}),
|
|
33
|
+
hide: id => setEntries(prev => prev.filter(e => e.id !== id)),
|
|
34
|
+
measureOrigin: callback => {
|
|
35
|
+
const node = ref.current;
|
|
36
|
+
if (!node) return callback({
|
|
37
|
+
x: 0,
|
|
38
|
+
y: 0
|
|
39
|
+
});
|
|
40
|
+
node.measureInWindow((x, y) => callback({
|
|
41
|
+
x,
|
|
42
|
+
y
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}), []);
|
|
46
|
+
return /*#__PURE__*/_jsx(ModalHostContext.Provider, {
|
|
47
|
+
value: api,
|
|
48
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
49
|
+
ref: ref,
|
|
50
|
+
collapsable: false,
|
|
51
|
+
style: [host.root, style],
|
|
52
|
+
children: [children, entries.map(entry => /*#__PURE__*/_jsx(View, {
|
|
53
|
+
style: StyleSheet.absoluteFill,
|
|
54
|
+
pointerEvents: "box-none",
|
|
55
|
+
children: entry.node
|
|
56
|
+
}, entry.id))]
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* React Native's `Modal`, or a layer in the nearest {@link WorkflowModalHost}
|
|
62
|
+
* when there is one. Same props as the subset of `Modal` the controls use.
|
|
63
|
+
*/
|
|
64
|
+
export function WorkflowModal({
|
|
65
|
+
visible,
|
|
66
|
+
transparent,
|
|
67
|
+
animationType,
|
|
68
|
+
onRequestClose,
|
|
69
|
+
children
|
|
70
|
+
}) {
|
|
71
|
+
const hostApi = useContext(ModalHostContext);
|
|
72
|
+
const id = useId();
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!hostApi) return;
|
|
75
|
+
if (visible) hostApi.show(id, /*#__PURE__*/_jsx(View, {
|
|
76
|
+
style: [StyleSheet.absoluteFill, transparent ? null : host.opaque],
|
|
77
|
+
children: children
|
|
78
|
+
}));else hostApi.hide(id);
|
|
79
|
+
}, [hostApi, id, visible, transparent, children]);
|
|
80
|
+
useEffect(() => () => hostApi?.hide(id), [hostApi, id]);
|
|
81
|
+
if (hostApi) return null;
|
|
82
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
83
|
+
visible: visible,
|
|
84
|
+
transparent: transparent,
|
|
85
|
+
animationType: animationType,
|
|
86
|
+
onRequestClose: onRequestClose,
|
|
87
|
+
children: children
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Converts a window position (from `measureInWindow`) into the coordinate
|
|
93
|
+
* space popups are drawn in: the host's when there is one, the window's
|
|
94
|
+
* otherwise.
|
|
95
|
+
*/
|
|
96
|
+
export function useModalPosition() {
|
|
97
|
+
const hostApi = useContext(ModalHostContext);
|
|
98
|
+
return useCallback((window, callback) => {
|
|
99
|
+
if (!hostApi) return callback(window);
|
|
100
|
+
hostApi.measureOrigin(origin => callback({
|
|
101
|
+
x: window.x - origin.x,
|
|
102
|
+
y: window.y - origin.y
|
|
103
|
+
}));
|
|
104
|
+
}, [hostApi]);
|
|
105
|
+
}
|
|
106
|
+
const host = StyleSheet.create({
|
|
107
|
+
root: {
|
|
108
|
+
position: 'relative',
|
|
109
|
+
overflow: 'hidden'
|
|
110
|
+
},
|
|
111
|
+
opaque: {
|
|
112
|
+
backgroundColor: '#000000'
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
//# sourceMappingURL=WorkflowModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","Modal","StyleSheet","View","jsx","_jsx","jsxs","_jsxs","ModalHostContext","WorkflowModalHost","children","style","entries","setEntries","ref","api","show","id","node","prev","index","findIndex","e","next","slice","hide","filter","measureOrigin","callback","current","x","y","measureInWindow","Provider","value","collapsable","host","root","map","entry","absoluteFill","pointerEvents","WorkflowModal","visible","transparent","animationType","onRequestClose","hostApi","opaque","useModalPosition","window","origin","create","position","overflow","backgroundColor"],"sourceRoot":"../../../src","sources":["modal/WorkflowModal.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAEbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,KAAK,EAAmCC,UAAU,EAAEC,IAAI,QAAwB,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWvG,MAAMC,gBAAgB,gBAAGf,aAAa,CAAsB,IAAI,CAAC;AAIjE;AACA;AACA;AACA;AACA;AACA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E,CAAC8B,OAAO,EAAE9B,EAAE,CAAC,CAAC;EAEvD,IAAI8B,OAAO,EAAE,OAAO,IAAI;EACxB,oBACE1C,IAAA,CAACJ,KAAK;IAAC0C,OAAO,EAAEA,OAAQ;IAACC,WAAW,EAAEA,WAAY;IAACC,aAAa,EAAEA,aAAc;IAACC,cAAc,EAAEA,cAAe;IAAApC,QAAA,EAC7GA;EAAQ,CACJ,CAAC;AAEZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASuC,gBAAgBA,CAAA,EAAgE;EAC9F,MAAMF,OAAO,GAAGpD,UAAU,CAACa,gBAAgB,CAAC;EAC5C,OAAOd,WAAW,CAChB,CAACwD,MAAM,EAAEtB,QAAQ,KAAK;IACpB,IAAI,CAACmB,OAAO,EAAE,OAAOnB,QAAQ,CAACsB,MAAM,CAAC;IACrCH,OAAO,CAACpB,aAAa,CAAEwB,MAAM,IAAKvB,QAAQ,CAAC;MAAEE,CAAC,EAAEoB,MAAM,CAACpB,CAAC,GAAGqB,MAAM,CAACrB,CAAC;MAAEC,CAAC,EAAEmB,MAAM,CAACnB,CAAC,GAAGoB,MAAM,CAACpB;IAAE,CAAC,CAAC,CAAC;EACjG,CAAC,EACD,CAACgB,OAAO,CACV,CAAC;AACH;AAEA,MAAMX,IAAI,GAAGlC,UAAU,CAACkD,MAAM,CAAC;EAC7Bf,IAAI,EAAE;IAAEgB,QAAQ,EAAE,UAAU;IAAEC,QAAQ,EAAE;EAAS,CAAC;EAClDN,MAAM,EAAE;IAAEO,eAAe,EAAE;EAAU;AACvC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native implementation (wallet). The web build ships `platformName.web.ts`
|
|
5
|
+
* next to this file; Metro picks this one, Vite (with `.web.*` extensions
|
|
6
|
+
* first) picks the web one. Device-only controls use the same pattern so web
|
|
7
|
+
* placeholders never import native modules.
|
|
8
|
+
*/
|
|
9
|
+
export const platformName = 'native';
|
|
10
|
+
//# sourceMappingURL=platformName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["platformName"],"sourceRoot":"../../../src","sources":["platform/platformName.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,YAA8B,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["platformName"],"sourceRoot":"../../../src","sources":["platform/platformName.web.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,YAA8B,GAAG,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Module-level store so a protocol-aware control's phase survives the
|
|
4
|
+
// component being unmounted and remounted (leaving and re-entering the
|
|
5
|
+
// workflow screen). Without this, a remount resets the control to its initial
|
|
6
|
+
// phase and resurrects the action buttons — a second tap then re-fires the
|
|
7
|
+
// workflow event, and templates with self-loop transitions duplicate real
|
|
8
|
+
// protocol work (e.g. a second credential offer for the same instance).
|
|
9
|
+
// v1: in-memory only — an app restart falls back to the initial phase.
|
|
10
|
+
|
|
11
|
+
const snapshots = new Map();
|
|
12
|
+
export const getControlSnapshot = key => key ? snapshots.get(key) : undefined;
|
|
13
|
+
export const saveControlSnapshot = (key, snapshot) => {
|
|
14
|
+
if (key) snapshots.set(key, snapshot);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Forget every saved phase (tests, or a host resetting a preview). */
|
|
18
|
+
export const clearControlSnapshots = () => snapshots.clear();
|
|
19
|
+
//# sourceMappingURL=controlSnapshotStore.js.map
|