@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,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { Image, StyleSheet, View } from 'react-native';
|
|
5
|
+
import WorkflowText from "../components/WorkflowText.js";
|
|
6
|
+
import { WorkflowIcon } from "../icons/WorkflowIcon.js";
|
|
7
|
+
import { prefetchImageUri } from "../imageUriCache.js";
|
|
8
|
+
import { ContentRegistry } from "../registries/ContentRegistry.js";
|
|
9
|
+
import { useResponsive } from "../responsive/index.js";
|
|
10
|
+
import { resolveAspectRatio, resolveItemSurfaceStyle } from "../style/resolveDisplayHintStyle.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const resolveImageUrl = item => {
|
|
13
|
+
const raw = typeof item.url === 'string' && item.url || typeof item.src === 'string' && item.src || typeof item.image === 'string' && item.image || undefined;
|
|
14
|
+
const trimmed = raw?.trim();
|
|
15
|
+
return trimmed ? trimmed : undefined;
|
|
16
|
+
};
|
|
17
|
+
const ImageErrorFrame = ({
|
|
18
|
+
width,
|
|
19
|
+
height,
|
|
20
|
+
maxWidth,
|
|
21
|
+
radius,
|
|
22
|
+
colors,
|
|
23
|
+
iconSize
|
|
24
|
+
}) => /*#__PURE__*/_jsxs(View, {
|
|
25
|
+
style: [local.errorFrame, {
|
|
26
|
+
width: width ?? '100%',
|
|
27
|
+
height,
|
|
28
|
+
maxWidth,
|
|
29
|
+
borderRadius: radius,
|
|
30
|
+
backgroundColor: colors.background,
|
|
31
|
+
borderColor: colors.border
|
|
32
|
+
}],
|
|
33
|
+
children: [/*#__PURE__*/_jsx(WorkflowIcon, {
|
|
34
|
+
set: "material-community",
|
|
35
|
+
name: "image-off-outline",
|
|
36
|
+
size: iconSize,
|
|
37
|
+
color: colors.border
|
|
38
|
+
}), /*#__PURE__*/_jsx(WorkflowText, {
|
|
39
|
+
variant: "caption",
|
|
40
|
+
numberOfLines: 1,
|
|
41
|
+
style: {
|
|
42
|
+
color: colors.text,
|
|
43
|
+
opacity: 0.7,
|
|
44
|
+
marginTop: 6
|
|
45
|
+
},
|
|
46
|
+
children: "Image unavailable"
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
const ImageContent = ({
|
|
50
|
+
item,
|
|
51
|
+
styles,
|
|
52
|
+
colors,
|
|
53
|
+
mediaFrame
|
|
54
|
+
}) => {
|
|
55
|
+
const {
|
|
56
|
+
s,
|
|
57
|
+
isSmall
|
|
58
|
+
} = useResponsive();
|
|
59
|
+
const imageUrl = resolveImageUrl(item);
|
|
60
|
+
const [failed, setFailed] = useState(false);
|
|
61
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
62
|
+
const [aspectRatio, setAspectRatio] = useState(16 / 9);
|
|
63
|
+
const maxImageHeight = s(isSmall ? 180 : 220);
|
|
64
|
+
const radius = s(8);
|
|
65
|
+
const iconSize = s(isSmall ? 28 : 36);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
setFailed(false);
|
|
68
|
+
prefetchImageUri(imageUrl);
|
|
69
|
+
}, [imageUrl]);
|
|
70
|
+
const alignSelf = item.align === 'center' ? 'center' : item.align === 'right' || item.align === 'end' ? 'flex-end' : 'stretch';
|
|
71
|
+
if (mediaFrame) {
|
|
72
|
+
if (!imageUrl || failed) {
|
|
73
|
+
return /*#__PURE__*/_jsx(ImageErrorFrame, {
|
|
74
|
+
height: mediaFrame.height,
|
|
75
|
+
maxWidth: mediaFrame.width,
|
|
76
|
+
radius: radius,
|
|
77
|
+
colors: colors,
|
|
78
|
+
iconSize: iconSize
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/_jsx(View, {
|
|
82
|
+
style: [local.frameWrap, {
|
|
83
|
+
width: '100%',
|
|
84
|
+
height: mediaFrame.height,
|
|
85
|
+
maxWidth: mediaFrame.width,
|
|
86
|
+
borderRadius: radius
|
|
87
|
+
}],
|
|
88
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
89
|
+
source: {
|
|
90
|
+
uri: imageUrl
|
|
91
|
+
},
|
|
92
|
+
style: local.frameImage,
|
|
93
|
+
resizeMode: mediaFrame.mode || 'cover',
|
|
94
|
+
onError: () => setFailed(true)
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (!imageUrl || failed) {
|
|
99
|
+
return /*#__PURE__*/_jsx(View, {
|
|
100
|
+
style: [styles.fieldContainer, resolveItemSurfaceStyle(item), local.wrap, {
|
|
101
|
+
marginBottom: 0
|
|
102
|
+
}],
|
|
103
|
+
children: /*#__PURE__*/_jsx(ImageErrorFrame, {
|
|
104
|
+
height: typeof item.height === 'number' ? item.height : maxImageHeight,
|
|
105
|
+
radius: radius,
|
|
106
|
+
colors: colors,
|
|
107
|
+
iconSize: iconSize
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const onContainerLayout = event => {
|
|
112
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
113
|
+
if (nextWidth > 0 && Math.abs(nextWidth - containerWidth) > 1) {
|
|
114
|
+
setContainerWidth(nextWidth);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const hintedWidth = typeof item.width === 'number' && Number.isFinite(item.width) ? item.width : undefined;
|
|
118
|
+
const hintedHeight = typeof item.height === 'number' && Number.isFinite(item.height) ? item.height : typeof item.minHeight === 'number' && Number.isFinite(item.minHeight) ? item.minHeight : undefined;
|
|
119
|
+
const hintedRatio = resolveAspectRatio(item.aspectRatio ?? item.ratio);
|
|
120
|
+
const useFixedThumb = hintedWidth != null && hintedHeight != null;
|
|
121
|
+
const usePixelThumb = useFixedThumb && item.fixedPx === true;
|
|
122
|
+
const sizeOf = n => usePixelThumb ? n : s(n);
|
|
123
|
+
const useHintedFrame = !useFixedThumb && (hintedHeight != null || hintedRatio != null);
|
|
124
|
+
const fittedHeight = useFixedThumb ? hintedHeight : useHintedFrame ? hintedHeight ?? (containerWidth > 0 && hintedRatio != null ? Math.min(containerWidth / hintedRatio, maxImageHeight) : maxImageHeight) : containerWidth > 0 ? Math.min(containerWidth / aspectRatio, maxImageHeight) : maxImageHeight;
|
|
125
|
+
const fittedWidth = useFixedThumb ? sizeOf(hintedWidth) : containerWidth > 0 ? containerWidth : '100%';
|
|
126
|
+
return /*#__PURE__*/_jsx(View, {
|
|
127
|
+
style: [useFixedThumb ? null : styles.fieldContainer, resolveItemSurfaceStyle(item), local.wrap, {
|
|
128
|
+
marginBottom: 0,
|
|
129
|
+
width: useFixedThumb ? sizeOf(hintedWidth) : '100%',
|
|
130
|
+
maxWidth: useFixedThumb ? sizeOf(hintedWidth) : '100%',
|
|
131
|
+
alignSelf: useFixedThumb ? 'center' : alignSelf
|
|
132
|
+
}],
|
|
133
|
+
onLayout: useFixedThumb ? undefined : onContainerLayout,
|
|
134
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
135
|
+
source: {
|
|
136
|
+
uri: imageUrl
|
|
137
|
+
},
|
|
138
|
+
style: [local.image, {
|
|
139
|
+
width: fittedWidth,
|
|
140
|
+
maxWidth: '100%',
|
|
141
|
+
height: useFixedThumb ? sizeOf(hintedHeight) : fittedHeight,
|
|
142
|
+
alignSelf: useFixedThumb ? 'center' : alignSelf,
|
|
143
|
+
borderRadius: typeof item.borderRadius === 'number' ? s(item.borderRadius) : radius
|
|
144
|
+
}],
|
|
145
|
+
resizeMode: "cover",
|
|
146
|
+
onLoad: event => {
|
|
147
|
+
if (useHintedFrame || useFixedThumb) return;
|
|
148
|
+
const {
|
|
149
|
+
width,
|
|
150
|
+
height
|
|
151
|
+
} = event.nativeEvent.source;
|
|
152
|
+
if (width > 0 && height > 0) {
|
|
153
|
+
setAspectRatio(width / height);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
onError: () => setFailed(true)
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const local = StyleSheet.create({
|
|
161
|
+
wrap: {
|
|
162
|
+
width: '100%',
|
|
163
|
+
maxWidth: '100%',
|
|
164
|
+
overflow: 'hidden'
|
|
165
|
+
},
|
|
166
|
+
image: {
|
|
167
|
+
backgroundColor: 'transparent'
|
|
168
|
+
},
|
|
169
|
+
frameWrap: {
|
|
170
|
+
overflow: 'hidden',
|
|
171
|
+
width: '100%',
|
|
172
|
+
maxWidth: '100%'
|
|
173
|
+
},
|
|
174
|
+
frameImage: {
|
|
175
|
+
width: '100%',
|
|
176
|
+
height: '100%'
|
|
177
|
+
},
|
|
178
|
+
errorFrame: {
|
|
179
|
+
width: '100%',
|
|
180
|
+
maxWidth: '100%',
|
|
181
|
+
alignSelf: 'stretch',
|
|
182
|
+
alignItems: 'center',
|
|
183
|
+
justifyContent: 'center',
|
|
184
|
+
borderWidth: 1,
|
|
185
|
+
borderStyle: 'dashed'
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
ContentRegistry.register('image', ImageContent);
|
|
189
|
+
export default ImageContent;
|
|
190
|
+
//# sourceMappingURL=ImageContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Image","StyleSheet","View","WorkflowText","WorkflowIcon","prefetchImageUri","ContentRegistry","useResponsive","resolveAspectRatio","resolveItemSurfaceStyle","jsx","_jsx","jsxs","_jsxs","resolveImageUrl","item","raw","url","src","image","undefined","trimmed","trim","ImageErrorFrame","width","height","maxWidth","radius","colors","iconSize","style","local","errorFrame","borderRadius","backgroundColor","background","borderColor","border","children","set","name","size","color","variant","numberOfLines","text","opacity","marginTop","ImageContent","styles","mediaFrame","s","isSmall","imageUrl","failed","setFailed","containerWidth","setContainerWidth","aspectRatio","setAspectRatio","maxImageHeight","alignSelf","align","frameWrap","source","uri","frameImage","resizeMode","mode","onError","fieldContainer","wrap","marginBottom","onContainerLayout","event","nextWidth","nativeEvent","layout","Math","abs","hintedWidth","Number","isFinite","hintedHeight","minHeight","hintedRatio","ratio","useFixedThumb","usePixelThumb","fixedPx","sizeOf","n","useHintedFrame","fittedHeight","min","fittedWidth","onLayout","onLoad","create","overflow","alignItems","justifyContent","borderWidth","borderStyle","register"],"sourceRoot":"../../../src","sources":["content/ImageContent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAElD,SAASC,KAAK,EAA0BC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC9E,OAAOC,YAAY,MAAM,+BAA4B;AACrD,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,gBAAgB,QAAQ,qBAAkB;AACnD,SAA4BC,eAAe,QAAQ,kCAA+B;AAClF,SAASC,aAAa,QAAQ,wBAAe;AAC7C,SAASC,kBAAkB,EAAEC,uBAAuB,QAAQ,qCAAkC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9F,MAAMC,eAAe,GAAIC,IAA0B,IAAyB;EAC1E,MAAMC,GAAG,GACN,OAAOD,IAAI,CAACE,GAAG,KAAK,QAAQ,IAAIF,IAAI,CAACE,GAAG,IACxC,OAAOF,IAAI,CAACG,GAAG,KAAK,QAAQ,IAAIH,IAAI,CAACG,GAAI,IACzC,OAAOH,IAAI,CAACI,KAAK,KAAK,QAAQ,IAAIJ,IAAI,CAACI,KAAM,IAC9CC,SAAS;EACX,MAAMC,OAAO,GAAGL,GAAG,EAAEM,IAAI,CAAC,CAAC;EAC3B,OAAOD,OAAO,GAAGA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EAAE,MAAM;IAChByE,QAAQ,EAAE;EACZ,CAAC;EACDhF,KAAK,EAAE;IACLe,eAAe,EAAE;EACnB,CAAC;EACD6B,SAAS,EAAE;IACToC,QAAQ,EAAE,QAAQ;IAClB3E,KAAK,EAAE,MAAM;IACbE,QAAQ,EAAE;EACZ,CAAC;EACDwC,UAAU,EAAE;IACV1C,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDO,UAAU,EAAE;IACVR,KAAK,EAAE,MAAM;IACbE,QAAQ,EAAE,MAAM;IAChBmC,SAAS,EAAE,SAAS;IACpBuC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEFjG,eAAe,CAACkG,QAAQ,CAAC,OAAO,EAAExD,YAAY,CAAC;AAE/C,eAAeA,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import WorkflowText from "../components/WorkflowText.js";
|
|
6
|
+
import { ContentRegistry } from "../registries/ContentRegistry.js";
|
|
7
|
+
import { useResponsive } from "../responsive/index.js";
|
|
8
|
+
import { resolveItemSurfaceStyle } from "../style/resolveDisplayHintStyle.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const resolveChildLabel = child => {
|
|
11
|
+
const candidates = [child.text, child.title, child.label, child.subtitle];
|
|
12
|
+
for (const value of candidates) {
|
|
13
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
14
|
+
return value.trim();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
};
|
|
19
|
+
const ListContent = ({
|
|
20
|
+
item,
|
|
21
|
+
styles,
|
|
22
|
+
colors,
|
|
23
|
+
onAction,
|
|
24
|
+
formData,
|
|
25
|
+
onFieldChange,
|
|
26
|
+
FormFieldRegistry,
|
|
27
|
+
buttonVariant
|
|
28
|
+
}) => {
|
|
29
|
+
const {
|
|
30
|
+
s,
|
|
31
|
+
ms
|
|
32
|
+
} = useResponsive();
|
|
33
|
+
const listItems = Array.isArray(item.items) ? item.items : [];
|
|
34
|
+
const children = Array.isArray(item.children) ? item.children : [];
|
|
35
|
+
if (listItems.length === 0 && children.length === 0) return null;
|
|
36
|
+
const bulletRow = (key, body) => /*#__PURE__*/_jsxs(View, {
|
|
37
|
+
style: {
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'flex-start',
|
|
40
|
+
marginBottom: s(6),
|
|
41
|
+
minWidth: 0,
|
|
42
|
+
width: '100%'
|
|
43
|
+
},
|
|
44
|
+
children: [/*#__PURE__*/_jsx(WorkflowText, {
|
|
45
|
+
variant: "body",
|
|
46
|
+
size: 14,
|
|
47
|
+
style: {
|
|
48
|
+
color: colors.text,
|
|
49
|
+
marginRight: s(8),
|
|
50
|
+
marginTop: s(2)
|
|
51
|
+
},
|
|
52
|
+
children: '•'
|
|
53
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
54
|
+
style: {
|
|
55
|
+
flex: 1,
|
|
56
|
+
minWidth: 0
|
|
57
|
+
},
|
|
58
|
+
children: body
|
|
59
|
+
})]
|
|
60
|
+
}, key);
|
|
61
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
62
|
+
style: [styles.fieldContainer, resolveItemSurfaceStyle(item), {
|
|
63
|
+
marginBottom: 0,
|
|
64
|
+
width: '100%',
|
|
65
|
+
maxWidth: '100%'
|
|
66
|
+
}],
|
|
67
|
+
children: [listItems.map((text, i) => bulletRow(`li-${i}`, /*#__PURE__*/_jsx(WorkflowText, {
|
|
68
|
+
variant: "body",
|
|
69
|
+
size: 14,
|
|
70
|
+
style: {
|
|
71
|
+
color: colors.text,
|
|
72
|
+
flex: 1,
|
|
73
|
+
lineHeight: ms(20)
|
|
74
|
+
},
|
|
75
|
+
children: text
|
|
76
|
+
}))), children.map((child, i) => {
|
|
77
|
+
const key = String(child._id ?? `child-${i}`);
|
|
78
|
+
const label = resolveChildLabel(child);
|
|
79
|
+
const isPlainText = ['text', 'title'].includes(String(child.type)) && !!label;
|
|
80
|
+
if (isPlainText) {
|
|
81
|
+
return bulletRow(key, /*#__PURE__*/_jsx(WorkflowText, {
|
|
82
|
+
variant: "body",
|
|
83
|
+
size: 14,
|
|
84
|
+
style: {
|
|
85
|
+
color: colors.text,
|
|
86
|
+
lineHeight: ms(20)
|
|
87
|
+
},
|
|
88
|
+
children: label
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
if (!ContentRegistry.has(child.type)) return null;
|
|
92
|
+
return bulletRow(key, ContentRegistry.render(child.type, {
|
|
93
|
+
item: child,
|
|
94
|
+
onAction,
|
|
95
|
+
styles,
|
|
96
|
+
colors,
|
|
97
|
+
formData,
|
|
98
|
+
onFieldChange,
|
|
99
|
+
FormFieldRegistry,
|
|
100
|
+
buttonVariant
|
|
101
|
+
}));
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
ContentRegistry.register('list', ListContent);
|
|
106
|
+
export default ListContent;
|
|
107
|
+
//# sourceMappingURL=ListContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","WorkflowText","ContentRegistry","useResponsive","resolveItemSurfaceStyle","jsx","_jsx","jsxs","_jsxs","resolveChildLabel","child","candidates","text","title","label","subtitle","value","trim","length","undefined","ListContent","item","styles","colors","onAction","formData","onFieldChange","FormFieldRegistry","buttonVariant","s","ms","listItems","Array","isArray","items","children","bulletRow","key","body","style","flexDirection","alignItems","marginBottom","minWidth","width","variant","size","color","marginRight","marginTop","flex","fieldContainer","maxWidth","map","i","lineHeight","String","_id","isPlainText","includes","type","has","render","register"],"sourceRoot":"../../../src","sources":["content/ListContent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAA0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+
import React, { useState } from 'react';
|
|
4
|
+
import { ActivityIndicator, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { useWalletAdapter } from "../adapter/WalletAdapter.js";
|
|
6
|
+
import WorkflowButtonLabel from "../components/WorkflowButtonLabel.js";
|
|
7
|
+
import { useWorkflowT } from "../i18n/WorkflowI18n.js";
|
|
8
|
+
import { WorkflowIcon } from "../icons/WorkflowIcon.js";
|
|
9
|
+
import { ContentRegistry } from "../registries/ContentRegistry.js";
|
|
10
|
+
import { useResponsive } from "../responsive/index.js";
|
|
11
|
+
import { resolveButtonFillStyle, resolveItemSurfaceStyle, resolveSurfaceBackground } from "../style/resolveDisplayHintStyle.js";
|
|
12
|
+
import { testIdWithKey } from "../utils/testable.js";
|
|
13
|
+
import { SimulatedHint } from "./SimulatedHint.js";
|
|
14
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const WHITE = '#FFFFFF';
|
|
16
|
+
export const mapsUrl = (latitude, longitude) => `https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}`;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* "Share location" pill: reads the position (`adapter.getLocation()`), sends
|
|
20
|
+
* `{ latitude, longitude }` to `form-id` and to `actionID` / `event`, then
|
|
21
|
+
* opens the share sheet with the coordinates and a maps link.
|
|
22
|
+
*/
|
|
23
|
+
const LocationContent = ({
|
|
24
|
+
item,
|
|
25
|
+
onAction,
|
|
26
|
+
onFieldChange,
|
|
27
|
+
fillContainer,
|
|
28
|
+
groupFontScale = 1,
|
|
29
|
+
disabled
|
|
30
|
+
}) => {
|
|
31
|
+
const t = useWorkflowT();
|
|
32
|
+
const adapter = useWalletAdapter();
|
|
33
|
+
const {
|
|
34
|
+
s,
|
|
35
|
+
ms,
|
|
36
|
+
isSmall
|
|
37
|
+
} = useResponsive();
|
|
38
|
+
const label = typeof item.label === 'string' && item.label || t('WorkflowUi.ShareLocation');
|
|
39
|
+
const formId = item['form-id'];
|
|
40
|
+
const actionId = item.actionID || item.event;
|
|
41
|
+
const [loading, setLoading] = useState(false);
|
|
42
|
+
const handlePress = async () => {
|
|
43
|
+
if (loading || disabled) return;
|
|
44
|
+
setLoading(true);
|
|
45
|
+
try {
|
|
46
|
+
const coords = await adapter.getLocation();
|
|
47
|
+
if (!coords) {
|
|
48
|
+
adapter.alert(t('WorkflowUi.LocationUnavailable'), t('WorkflowUi.LocationUnavailableMessage'));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const {
|
|
52
|
+
latitude,
|
|
53
|
+
longitude
|
|
54
|
+
} = coords;
|
|
55
|
+
const payload = {
|
|
56
|
+
latitude,
|
|
57
|
+
longitude
|
|
58
|
+
};
|
|
59
|
+
if (formId) onFieldChange?.(formId, payload);
|
|
60
|
+
if (actionId) onAction(actionId, payload);
|
|
61
|
+
const coordText = `${latitude.toFixed(6)}, ${longitude.toFixed(6)}`;
|
|
62
|
+
await adapter.share({
|
|
63
|
+
title: t('WorkflowUi.ShareLocation'),
|
|
64
|
+
subject: t('WorkflowUi.ShareLocation'),
|
|
65
|
+
message: `${t('WorkflowUi.MyLocation')}\n${coordText}\n\n${mapsUrl(latitude, longitude)}`
|
|
66
|
+
}).catch(() => adapter.alert(t('WorkflowUi.Error'), t('WorkflowUi.ShareFailed')));
|
|
67
|
+
} catch {
|
|
68
|
+
adapter.alert(t('WorkflowUi.LocationUnavailable'), t('WorkflowUi.LocationUnavailableMessage'));
|
|
69
|
+
} finally {
|
|
70
|
+
setLoading(false);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const isTransparent = resolveSurfaceBackground(item.bgColor) === 'transparent';
|
|
74
|
+
const minHeight = s(isSmall ? 44 : 52);
|
|
75
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
76
|
+
style: [pill.wrap, resolveItemSurfaceStyle(item), fillContainer ? {
|
|
77
|
+
flex: 1,
|
|
78
|
+
marginBottom: 0
|
|
79
|
+
} : null],
|
|
80
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
81
|
+
testID: testIdWithKey('WorkflowShareLocation'),
|
|
82
|
+
accessibilityLabel: label,
|
|
83
|
+
accessibilityRole: "button",
|
|
84
|
+
style: [pill.pill, {
|
|
85
|
+
minHeight,
|
|
86
|
+
borderRadius: minHeight / 2,
|
|
87
|
+
paddingVertical: s(isSmall ? 10 : 14),
|
|
88
|
+
paddingHorizontal: s(isSmall ? 10 : 16)
|
|
89
|
+
}, fillContainer ? {
|
|
90
|
+
flex: 1,
|
|
91
|
+
height: '100%'
|
|
92
|
+
} : null, resolveButtonFillStyle(item, {
|
|
93
|
+
includePadding: false
|
|
94
|
+
}), isTransparent ? {
|
|
95
|
+
backgroundColor: 'transparent',
|
|
96
|
+
borderWidth: 1.5,
|
|
97
|
+
borderColor: WHITE
|
|
98
|
+
} : null, disabled ? pill.disabled : null],
|
|
99
|
+
onPress: handlePress,
|
|
100
|
+
activeOpacity: 0.85,
|
|
101
|
+
disabled: loading || disabled,
|
|
102
|
+
children: loading ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
103
|
+
color: WHITE
|
|
104
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/_jsx(WorkflowIcon, {
|
|
106
|
+
name: "share",
|
|
107
|
+
size: s(18),
|
|
108
|
+
color: WHITE,
|
|
109
|
+
style: {
|
|
110
|
+
marginRight: s(8)
|
|
111
|
+
}
|
|
112
|
+
}), /*#__PURE__*/_jsx(WorkflowButtonLabel, {
|
|
113
|
+
style: [pill.text, {
|
|
114
|
+
color: WHITE,
|
|
115
|
+
fontSize: ms(isSmall ? 13 : 15)
|
|
116
|
+
}],
|
|
117
|
+
groupFontScale: groupFontScale,
|
|
118
|
+
children: label
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
}), adapter.simulated ? /*#__PURE__*/_jsx(SimulatedHint, {}) : null]
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/** Shared by the location and share pills. */
|
|
126
|
+
export const pill = StyleSheet.create({
|
|
127
|
+
wrap: {
|
|
128
|
+
marginBottom: 8
|
|
129
|
+
},
|
|
130
|
+
pill: {
|
|
131
|
+
flexDirection: 'row',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
width: '100%',
|
|
135
|
+
flexShrink: 1,
|
|
136
|
+
minWidth: 0
|
|
137
|
+
},
|
|
138
|
+
text: {
|
|
139
|
+
fontWeight: '700',
|
|
140
|
+
flexShrink: 1
|
|
141
|
+
},
|
|
142
|
+
disabled: {
|
|
143
|
+
opacity: 0.5
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
ContentRegistry.register('location', LocationContent);
|
|
147
|
+
export default LocationContent;
|
|
148
|
+
//# sourceMappingURL=LocationContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","ActivityIndicator","StyleSheet","TouchableOpacity","View","useWalletAdapter","WorkflowButtonLabel","useWorkflowT","WorkflowIcon","ContentRegistry","useResponsive","resolveButtonFillStyle","resolveItemSurfaceStyle","resolveSurfaceBackground","testIdWithKey","SimulatedHint","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WHITE","mapsUrl","latitude","longitude","LocationContent","item","onAction","onFieldChange","fillContainer","groupFontScale","disabled","t","adapter","s","ms","isSmall","label","formId","actionId","actionID","event","loading","setLoading","handlePress","coords","getLocation","alert","payload","coordText","toFixed","share","title","subject","message","catch","isTransparent","bgColor","minHeight","style","pill","wrap","flex","marginBottom","children","testID","accessibilityLabel","accessibilityRole","borderRadius","paddingVertical","paddingHorizontal","height","includePadding","backgroundColor","borderWidth","borderColor","onPress","activeOpacity","color","name","size","marginRight","text","fontSize","simulated","create","flexDirection","alignItems","justifyContent","width","flexShrink","minWidth","fontWeight","opacity","register"],"sourceRoot":"../../../src","sources":["content/LocationContent.tsx"],"mappings":";;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