@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,144 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { StyleSheet } from 'react-native'
|
|
3
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
4
|
+
import { FormFieldRegistry } from '../registries/FormFieldRegistry'
|
|
5
|
+
|
|
6
|
+
const bridgeStyles = StyleSheet.create({
|
|
7
|
+
input: {
|
|
8
|
+
borderWidth: 1,
|
|
9
|
+
borderRadius: 8,
|
|
10
|
+
paddingHorizontal: 12,
|
|
11
|
+
paddingVertical: 10,
|
|
12
|
+
fontSize: 15,
|
|
13
|
+
marginTop: 4,
|
|
14
|
+
},
|
|
15
|
+
checkboxRow: {
|
|
16
|
+
flexDirection: 'row',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
paddingVertical: 8,
|
|
19
|
+
},
|
|
20
|
+
checkbox: {
|
|
21
|
+
width: 22,
|
|
22
|
+
height: 22,
|
|
23
|
+
borderRadius: 4,
|
|
24
|
+
borderWidth: 2,
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
marginRight: 10,
|
|
28
|
+
},
|
|
29
|
+
checkboxLabel: {
|
|
30
|
+
fontSize: 15,
|
|
31
|
+
flex: 1,
|
|
32
|
+
},
|
|
33
|
+
radioRow: {
|
|
34
|
+
flexDirection: 'row',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
paddingVertical: 8,
|
|
37
|
+
},
|
|
38
|
+
radioOuter: {
|
|
39
|
+
width: 22,
|
|
40
|
+
height: 22,
|
|
41
|
+
borderRadius: 11,
|
|
42
|
+
borderWidth: 2,
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
marginRight: 10,
|
|
46
|
+
},
|
|
47
|
+
radioInner: {
|
|
48
|
+
width: 10,
|
|
49
|
+
height: 10,
|
|
50
|
+
borderRadius: 5,
|
|
51
|
+
backgroundColor: '#FFFFFF',
|
|
52
|
+
},
|
|
53
|
+
radioLabel: {
|
|
54
|
+
fontSize: 15,
|
|
55
|
+
flex: 1,
|
|
56
|
+
},
|
|
57
|
+
dropdown: {
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderRadius: 8,
|
|
60
|
+
paddingHorizontal: 12,
|
|
61
|
+
paddingVertical: 12,
|
|
62
|
+
marginTop: 4,
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
},
|
|
66
|
+
dateButton: {
|
|
67
|
+
borderWidth: 1,
|
|
68
|
+
borderRadius: 8,
|
|
69
|
+
paddingHorizontal: 12,
|
|
70
|
+
paddingVertical: 12,
|
|
71
|
+
marginTop: 4,
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
type FieldBuilder = (item: ContentProps['item']) => {
|
|
76
|
+
label: string
|
|
77
|
+
options?: string[]
|
|
78
|
+
min?: number
|
|
79
|
+
max?: number
|
|
80
|
+
placeholder?: string
|
|
81
|
+
required?: boolean
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
type BridgeEntry = { contentType: string; formFieldType: string; buildField?: FieldBuilder }
|
|
85
|
+
|
|
86
|
+
const defaultFieldBuilder: FieldBuilder = (item) => ({
|
|
87
|
+
label: ((item.label ?? item.text) as string | undefined) ?? '',
|
|
88
|
+
options: Array.isArray(item.options) ? (item.options as string[]) : undefined,
|
|
89
|
+
min: item.min != null ? Number(item.min) : undefined,
|
|
90
|
+
max: item.max != null ? Number(item.max) : undefined,
|
|
91
|
+
placeholder: item.placeholder as string | undefined,
|
|
92
|
+
required: item.required as boolean | undefined,
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const BRIDGE_MAPPINGS: BridgeEntry[] = [
|
|
96
|
+
{ contentType: 'text-input', formFieldType: 'text-input' },
|
|
97
|
+
{ contentType: 'text-area', formFieldType: 'text-area' },
|
|
98
|
+
{ contentType: 'text-field', formFieldType: 'text-field' },
|
|
99
|
+
{ contentType: 'check-box', formFieldType: 'check-box' },
|
|
100
|
+
{ contentType: 'drop-down', formFieldType: 'drop-down' },
|
|
101
|
+
{ contentType: 'date', formFieldType: 'date' },
|
|
102
|
+
// Contract aliases (HINT_ALIASES). The wallet rendered nothing for these at top level.
|
|
103
|
+
{ contentType: 'textarea', formFieldType: 'textarea' },
|
|
104
|
+
{ contentType: 'checkbox', formFieldType: 'checkbox' },
|
|
105
|
+
{ contentType: 'dropdown', formFieldType: 'dropdown' },
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
const createBridgeComponent = (formFieldType: string, buildField: FieldBuilder): React.FC<ContentProps> => {
|
|
109
|
+
const BridgeComponent: React.FC<ContentProps> = ({ item, styles, colors, formData, onFieldChange }) => {
|
|
110
|
+
const fieldName = ((item['form-id'] ?? item.name ?? item.id ?? item.type) as string) || formFieldType
|
|
111
|
+
const [localValue, setLocalValue] = useState<any>(formData?.[fieldName] ?? item.defaultValue ?? '')
|
|
112
|
+
|
|
113
|
+
const mergedStyles = { ...styles, ...bridgeStyles }
|
|
114
|
+
|
|
115
|
+
const builtField = buildField(item)
|
|
116
|
+
const field = {
|
|
117
|
+
type: item.type as string,
|
|
118
|
+
name: fieldName,
|
|
119
|
+
...builtField,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const handleChange = (val: any) => {
|
|
123
|
+
setLocalValue(val)
|
|
124
|
+
onFieldChange?.(fieldName, val)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return FormFieldRegistry.render(formFieldType, {
|
|
128
|
+
field,
|
|
129
|
+
value: localValue,
|
|
130
|
+
onChange: handleChange,
|
|
131
|
+
styles: mergedStyles,
|
|
132
|
+
colors,
|
|
133
|
+
}) as React.ReactElement | null
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
BridgeComponent.displayName = `FormFieldBridge_${formFieldType}`
|
|
137
|
+
return BridgeComponent
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
BRIDGE_MAPPINGS.forEach(({ contentType, formFieldType, buildField }) => {
|
|
141
|
+
if (!ContentRegistry.has(contentType)) {
|
|
142
|
+
ContentRegistry.register(contentType, createBridgeComponent(formFieldType, buildField ?? defaultFieldBuilder))
|
|
143
|
+
}
|
|
144
|
+
})
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Text, View } from 'react-native'
|
|
3
|
+
import Svg, { Path } from 'react-native-svg'
|
|
4
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
5
|
+
import { resolveItemSurfaceStyle } from '../style/resolveDisplayHintStyle'
|
|
6
|
+
|
|
7
|
+
const GaugeContent: React.FC<ContentProps> = ({ item, styles, colors }) => {
|
|
8
|
+
const value = parseFloat(item.value || '0')
|
|
9
|
+
const min = parseFloat(item.min || '0')
|
|
10
|
+
const max = parseFloat(item.max || '100')
|
|
11
|
+
|
|
12
|
+
// Calculate percentage
|
|
13
|
+
const percentage = ((value - min) / (max - min)) * 100
|
|
14
|
+
const clampedPercentage = Math.max(0, Math.min(100, percentage))
|
|
15
|
+
|
|
16
|
+
const size = 200
|
|
17
|
+
const radius = (size - 20) / 2
|
|
18
|
+
const strokeWidth = 20
|
|
19
|
+
const circumference = Math.PI * radius // Half circle
|
|
20
|
+
|
|
21
|
+
// Calculate dash offset
|
|
22
|
+
const dashOffset = circumference - (clampedPercentage / 100) * circumference
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<View style={[styles.fieldContainer, resolveItemSurfaceStyle(item)]}>
|
|
26
|
+
{item.title && (
|
|
27
|
+
<Text style={[styles.formLabel, { color: colors.text, marginBottom: 12, textAlign: 'center' }]}>
|
|
28
|
+
{item.title}
|
|
29
|
+
</Text>
|
|
30
|
+
)}
|
|
31
|
+
|
|
32
|
+
<View style={{ alignItems: 'center' }}>
|
|
33
|
+
<Svg width={size} height={size / 2 + 20}>
|
|
34
|
+
{/* Background arc */}
|
|
35
|
+
<Path
|
|
36
|
+
d={`M 10,${size / 2} A ${radius},${radius} 0 0,1 ${size - 10},${size / 2}`}
|
|
37
|
+
fill="none"
|
|
38
|
+
stroke={`${colors.primary}30`}
|
|
39
|
+
strokeWidth={strokeWidth}
|
|
40
|
+
strokeLinecap="round"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
{/* Progress arc */}
|
|
44
|
+
<Path
|
|
45
|
+
d={`M 10,${size / 2} A ${radius},${radius} 0 0,1 ${size - 10},${size / 2}`}
|
|
46
|
+
fill="none"
|
|
47
|
+
stroke={colors.primary}
|
|
48
|
+
strokeWidth={strokeWidth}
|
|
49
|
+
strokeLinecap="round"
|
|
50
|
+
strokeDasharray={`${circumference} ${circumference}`}
|
|
51
|
+
strokeDashoffset={dashOffset}
|
|
52
|
+
/>
|
|
53
|
+
</Svg>
|
|
54
|
+
|
|
55
|
+
<Text style={[styles.title, { color: colors.text, marginTop: 8 }]}>{value}</Text>
|
|
56
|
+
<Text style={[styles.description, { color: colors.text, fontSize: 12 }]}>
|
|
57
|
+
{min} - {max}
|
|
58
|
+
</Text>
|
|
59
|
+
</View>
|
|
60
|
+
</View>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ContentRegistry.register('gauge', GaugeContent)
|
|
65
|
+
|
|
66
|
+
export default GaugeContent
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react'
|
|
2
|
+
import type { DimensionValue } from 'react-native'
|
|
3
|
+
import { type LayoutChangeEvent, ScrollView, View } from 'react-native'
|
|
4
|
+
import { type ContentProps, ContentRegistry } from '../registries/ContentRegistry'
|
|
5
|
+
import { useResponsive } from '../responsive'
|
|
6
|
+
import { resolveItemBackgroundColor, resolveSurfacePadding } from '../style/resolveDisplayHintStyle'
|
|
7
|
+
import { coerceToChipRowItem } from './ChipRowContent'
|
|
8
|
+
|
|
9
|
+
const MEDIA_TYPES = new Set(['image', 'video', 'photo'])
|
|
10
|
+
|
|
11
|
+
const parseCol = (value: unknown): number => {
|
|
12
|
+
const n = Number(value)
|
|
13
|
+
if (!Number.isFinite(n) || n <= 0) return 12
|
|
14
|
+
return Math.max(1, Math.min(12, Math.floor(n)))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const GridLayoutContent: React.FC<ContentProps> = ({
|
|
18
|
+
item,
|
|
19
|
+
onAction,
|
|
20
|
+
styles,
|
|
21
|
+
colors,
|
|
22
|
+
formData,
|
|
23
|
+
onFieldChange,
|
|
24
|
+
buttonVariant,
|
|
25
|
+
disabled,
|
|
26
|
+
}) => {
|
|
27
|
+
const { s, isSmall, isTablet } = useResponsive()
|
|
28
|
+
const rawItems = (item.items ?? item.children ?? item.content ?? []) as ContentProps['item'][]
|
|
29
|
+
const gap = s(typeof item.gap === 'number' ? item.gap : 10)
|
|
30
|
+
const padding = resolveSurfacePadding(item.padding as number | string | undefined)
|
|
31
|
+
const pad = padding != null ? s(padding) : 0
|
|
32
|
+
const backgroundColor = resolveItemBackgroundColor(item)
|
|
33
|
+
const explicitColumns = Number(item.columns ?? item.cols ?? 0)
|
|
34
|
+
const orientation = String(item.orientation ?? item.direction ?? item.layout ?? 'horizontal').toLowerCase()
|
|
35
|
+
const isVertical = orientation === 'vertical' || orientation === 'column'
|
|
36
|
+
const forceScroll =
|
|
37
|
+
String(item.scroll ?? '').toLowerCase() === 'true' ||
|
|
38
|
+
item.scroll === true ||
|
|
39
|
+
String(item.wrap ?? '').toLowerCase() === 'false' ||
|
|
40
|
+
item.wrap === false
|
|
41
|
+
const isWrap =
|
|
42
|
+
!forceScroll && (orientation === 'wrap' || String(item.wrap ?? '').toLowerCase() === 'true' || item.wrap === true)
|
|
43
|
+
const useWrap = isWrap && !isVertical
|
|
44
|
+
const [containerWidth, setContainerWidth] = useState(0)
|
|
45
|
+
const [firstCellHeight, setFirstCellHeight] = useState(0)
|
|
46
|
+
|
|
47
|
+
const onLayout = useCallback((event: LayoutChangeEvent) => {
|
|
48
|
+
const next = Math.floor(event.nativeEvent.layout.width)
|
|
49
|
+
if (next > 0) {
|
|
50
|
+
setContainerWidth((prev) => (Math.abs(prev - next) > 1 ? next : prev))
|
|
51
|
+
}
|
|
52
|
+
}, [])
|
|
53
|
+
|
|
54
|
+
const onFirstCellLayout = useCallback((event: LayoutChangeEvent) => {
|
|
55
|
+
const next = Math.ceil(event.nativeEvent.layout.height)
|
|
56
|
+
if (next > 0) {
|
|
57
|
+
setFirstCellHeight((prev) => (Math.abs(prev - next) > 1 ? next : prev))
|
|
58
|
+
}
|
|
59
|
+
}, [])
|
|
60
|
+
|
|
61
|
+
const scrollChildWidth = useMemo(() => {
|
|
62
|
+
const ratio = isTablet ? 0.36 : isSmall ? 0.58 : 0.48
|
|
63
|
+
const minW = s(isSmall ? 132 : 148)
|
|
64
|
+
if (containerWidth <= 0) return minW
|
|
65
|
+
return Math.max(minW, Math.floor(containerWidth * ratio))
|
|
66
|
+
}, [containerWidth, isTablet, isSmall, s])
|
|
67
|
+
|
|
68
|
+
const wrapColCount = useMemo(() => {
|
|
69
|
+
if (isVertical) return 1
|
|
70
|
+
if (explicitColumns > 0) return Math.max(1, Math.min(4, Math.floor(explicitColumns)))
|
|
71
|
+
if (rawItems.length === 0) return 1
|
|
72
|
+
const spans = rawItems.map((child) => parseCol(child.col))
|
|
73
|
+
const minSpan = Math.min(...spans)
|
|
74
|
+
if (minSpan >= 12) return 1
|
|
75
|
+
return Math.max(1, Math.floor(12 / minSpan))
|
|
76
|
+
}, [isVertical, explicitColumns, rawItems])
|
|
77
|
+
|
|
78
|
+
const wrapCellWidth = useMemo(() => {
|
|
79
|
+
if (containerWidth <= 0) return undefined
|
|
80
|
+
const inner = Math.max(containerWidth - pad * 2 - gap * (wrapColCount - 1), 1)
|
|
81
|
+
return Math.floor(inner / wrapColCount)
|
|
82
|
+
}, [containerWidth, pad, gap, wrapColCount])
|
|
83
|
+
|
|
84
|
+
if (rawItems.length === 0) return null
|
|
85
|
+
|
|
86
|
+
const chipRowItem = coerceToChipRowItem({
|
|
87
|
+
...item,
|
|
88
|
+
type: item.type || 'grid',
|
|
89
|
+
children: rawItems,
|
|
90
|
+
items: rawItems,
|
|
91
|
+
scroll: true,
|
|
92
|
+
wrap: false,
|
|
93
|
+
})
|
|
94
|
+
if (chipRowItem && ContentRegistry.has('chip-row')) {
|
|
95
|
+
return (
|
|
96
|
+
<View style={{ width: '100%', maxWidth: '100%', backgroundColor, padding: pad || undefined }}>
|
|
97
|
+
{ContentRegistry.render('chip-row', {
|
|
98
|
+
item: chipRowItem,
|
|
99
|
+
onAction,
|
|
100
|
+
styles,
|
|
101
|
+
colors,
|
|
102
|
+
formData,
|
|
103
|
+
onFieldChange,
|
|
104
|
+
buttonVariant,
|
|
105
|
+
disabled,
|
|
106
|
+
})}
|
|
107
|
+
</View>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const renderCell = (
|
|
112
|
+
child: ContentProps['item'],
|
|
113
|
+
index: number,
|
|
114
|
+
width: number | string,
|
|
115
|
+
fill: boolean,
|
|
116
|
+
center = false,
|
|
117
|
+
onCellLayout?: (event: LayoutChangeEvent) => void,
|
|
118
|
+
minHeight?: number
|
|
119
|
+
) => {
|
|
120
|
+
if (!ContentRegistry.has(child.type)) return null
|
|
121
|
+
return (
|
|
122
|
+
<View
|
|
123
|
+
key={`grid-cell-${index}`}
|
|
124
|
+
onLayout={onCellLayout}
|
|
125
|
+
style={{
|
|
126
|
+
width: width as DimensionValue,
|
|
127
|
+
maxWidth: width as DimensionValue,
|
|
128
|
+
minWidth: 0,
|
|
129
|
+
minHeight: minHeight && minHeight > 0 ? minHeight : undefined,
|
|
130
|
+
flexGrow: 0,
|
|
131
|
+
flexShrink: 0,
|
|
132
|
+
alignSelf: center ? 'center' : 'stretch',
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
{ContentRegistry.render(child.type, {
|
|
136
|
+
item: child,
|
|
137
|
+
onAction,
|
|
138
|
+
styles,
|
|
139
|
+
colors,
|
|
140
|
+
formData,
|
|
141
|
+
onFieldChange,
|
|
142
|
+
buttonVariant,
|
|
143
|
+
fillContainer: fill,
|
|
144
|
+
disabled,
|
|
145
|
+
})}
|
|
146
|
+
</View>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (isVertical) {
|
|
151
|
+
const centerKids = String(item.align ?? '').toLowerCase() === 'center'
|
|
152
|
+
const peek = s(44)
|
|
153
|
+
const measuredMaxHeight = firstCellHeight > 0 ? firstCellHeight + gap + peek : undefined
|
|
154
|
+
const maxHeight = measuredMaxHeight ?? s(420)
|
|
155
|
+
const cellWidth = centerKids ? ('82%' as const) : ('100%' as const)
|
|
156
|
+
const cells = rawItems.map((child, index) =>
|
|
157
|
+
renderCell(
|
|
158
|
+
child,
|
|
159
|
+
index,
|
|
160
|
+
cellWidth,
|
|
161
|
+
true,
|
|
162
|
+
centerKids,
|
|
163
|
+
index === 0 ? onFirstCellLayout : undefined,
|
|
164
|
+
firstCellHeight > 0 ? firstCellHeight : undefined
|
|
165
|
+
)
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
if (maxHeight != null) {
|
|
169
|
+
return (
|
|
170
|
+
<View
|
|
171
|
+
onLayout={onLayout}
|
|
172
|
+
style={{
|
|
173
|
+
width: '100%',
|
|
174
|
+
maxWidth: '100%',
|
|
175
|
+
maxHeight,
|
|
176
|
+
padding: pad > 0 ? pad : undefined,
|
|
177
|
+
backgroundColor,
|
|
178
|
+
overflow: 'hidden',
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
<ScrollView
|
|
182
|
+
style={{ maxHeight, width: '100%' }}
|
|
183
|
+
contentContainerStyle={{
|
|
184
|
+
flexDirection: 'column',
|
|
185
|
+
alignItems: centerKids ? 'center' : 'stretch',
|
|
186
|
+
gap,
|
|
187
|
+
paddingVertical: s(2),
|
|
188
|
+
}}
|
|
189
|
+
showsVerticalScrollIndicator={false}
|
|
190
|
+
nestedScrollEnabled
|
|
191
|
+
>
|
|
192
|
+
{cells}
|
|
193
|
+
</ScrollView>
|
|
194
|
+
</View>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<View
|
|
200
|
+
onLayout={onLayout}
|
|
201
|
+
style={{
|
|
202
|
+
width: '100%',
|
|
203
|
+
maxWidth: '100%',
|
|
204
|
+
flexDirection: 'column',
|
|
205
|
+
alignItems: centerKids ? 'center' : 'stretch',
|
|
206
|
+
gap,
|
|
207
|
+
padding: pad > 0 ? pad : undefined,
|
|
208
|
+
backgroundColor,
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
{cells}
|
|
212
|
+
</View>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (useWrap) {
|
|
217
|
+
return (
|
|
218
|
+
<View
|
|
219
|
+
onLayout={onLayout}
|
|
220
|
+
style={{
|
|
221
|
+
width: '100%',
|
|
222
|
+
maxWidth: '100%',
|
|
223
|
+
flexDirection: 'row',
|
|
224
|
+
flexWrap: 'wrap',
|
|
225
|
+
alignItems: 'stretch',
|
|
226
|
+
gap,
|
|
227
|
+
padding: pad > 0 ? pad : undefined,
|
|
228
|
+
backgroundColor,
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
{rawItems.map((child, index) => {
|
|
232
|
+
const span = parseCol(child.col)
|
|
233
|
+
const units = Math.max(1, Math.min(wrapColCount, Math.round((span / 12) * wrapColCount)))
|
|
234
|
+
const width =
|
|
235
|
+
wrapCellWidth != null
|
|
236
|
+
? wrapCellWidth * units + gap * (units - 1)
|
|
237
|
+
: `${Math.floor((100 / wrapColCount) * units)}%`
|
|
238
|
+
return renderCell(child, index, width, MEDIA_TYPES.has(child.type))
|
|
239
|
+
})}
|
|
240
|
+
</View>
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<View
|
|
246
|
+
onLayout={onLayout}
|
|
247
|
+
style={{
|
|
248
|
+
width: '100%',
|
|
249
|
+
maxWidth: '100%',
|
|
250
|
+
padding: pad > 0 ? pad : undefined,
|
|
251
|
+
backgroundColor,
|
|
252
|
+
}}
|
|
253
|
+
>
|
|
254
|
+
<ScrollView
|
|
255
|
+
horizontal
|
|
256
|
+
showsHorizontalScrollIndicator={false}
|
|
257
|
+
decelerationRate="fast"
|
|
258
|
+
contentContainerStyle={{
|
|
259
|
+
flexDirection: 'row',
|
|
260
|
+
alignItems: 'stretch',
|
|
261
|
+
gap,
|
|
262
|
+
paddingVertical: s(2),
|
|
263
|
+
}}
|
|
264
|
+
>
|
|
265
|
+
{rawItems.map((child, index) =>
|
|
266
|
+
renderCell(
|
|
267
|
+
child,
|
|
268
|
+
index,
|
|
269
|
+
scrollChildWidth,
|
|
270
|
+
true,
|
|
271
|
+
false,
|
|
272
|
+
index === 0 ? onFirstCellLayout : undefined,
|
|
273
|
+
firstCellHeight > 0 ? firstCellHeight : undefined
|
|
274
|
+
)
|
|
275
|
+
)}
|
|
276
|
+
</ScrollView>
|
|
277
|
+
</View>
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
ContentRegistry.register('grid-layout', GridLayoutContent)
|
|
282
|
+
ContentRegistry.register('grid_layout', GridLayoutContent)
|
|
283
|
+
ContentRegistry.register('grid', GridLayoutContent)
|
|
284
|
+
|
|
285
|
+
export default GridLayoutContent
|