@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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native has no built-in player: the wallet passes its expo-video view as
|
|
5
|
+
* `adapter.VideoPlayer`. Without one the control keeps showing the poster.
|
|
6
|
+
*/
|
|
7
|
+
export default function FallbackVideoPlayer(_props) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FallbackVideoPlayer.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FallbackVideoPlayer","_props"],"sourceRoot":"../../../src","sources":["components/FallbackVideoPlayer.native.tsx"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,eAAe,SAASA,mBAAmBA,CAACC,MAAwB,EAAQ;EAC1E,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* Web video when the adapter has no `VideoPlayer`: the browser's own
|
|
8
|
+
* `<video>` element with native controls (expo-video has no web build that
|
|
9
|
+
* works outside Expo; see the COM-1 spike).
|
|
10
|
+
*/
|
|
11
|
+
export default function FallbackVideoPlayer({
|
|
12
|
+
uri,
|
|
13
|
+
autoPlay,
|
|
14
|
+
style,
|
|
15
|
+
onError
|
|
16
|
+
}) {
|
|
17
|
+
return /*#__PURE__*/_jsx(View, {
|
|
18
|
+
style: [StyleSheet.absoluteFill, style],
|
|
19
|
+
children: /*#__PURE__*/React.createElement('video', {
|
|
20
|
+
src: uri,
|
|
21
|
+
controls: true,
|
|
22
|
+
autoPlay: true,
|
|
23
|
+
muted: autoPlay,
|
|
24
|
+
playsInline: true,
|
|
25
|
+
onError,
|
|
26
|
+
style: {
|
|
27
|
+
width: '100%',
|
|
28
|
+
height: '100%',
|
|
29
|
+
objectFit: 'contain',
|
|
30
|
+
backgroundColor: '#000'
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=FallbackVideoPlayer.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","jsx","_jsx","FallbackVideoPlayer","uri","autoPlay","style","onError","absoluteFill","children","createElement","src","controls","muted","playsInline","width","height","objectFit","backgroundColor"],"sourceRoot":"../../../src","sources":["components/FallbackVideoPlayer.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAC;EAAEC,GAAG;EAAEC,QAAQ;EAAEC,KAAK;EAAEC;AAA0B,CAAC,EAAE;EAC/F,oBACEL,IAAA,CAACF,IAAI;IAACM,KAAK,EAAE,CAACP,UAAU,CAACS,YAAY,EAAEF,KAAK,CAAE;IAAAG,QAAA,eAC3CX,KAAK,CAACY,aAAa,CAAC,OAAO,EAAE;MAC5BC,GAAG,EAAEP,GAAG;MACRQ,QAAQ,EAAE,IAAI;MACdP,QAAQ,EAAE,IAAI;MACdQ,KAAK,EAAER,QAAQ;MACfS,WAAW,EAAE,IAAI;MACjBP,OAAO;MACPD,KAAK,EAAE;QAAES,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE,MAAM;QAAEC,SAAS,EAAE,SAAS;QAAEC,eAAe,EAAE;MAAO;IACxF,CAAC;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, Text } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const WorkflowButtonLabel = ({
|
|
7
|
+
children,
|
|
8
|
+
style,
|
|
9
|
+
minimumFontScale = 0.85,
|
|
10
|
+
groupFontScale = 1
|
|
11
|
+
}) => {
|
|
12
|
+
const flattened = StyleSheet.flatten(style);
|
|
13
|
+
const scaledFontSize = typeof flattened?.fontSize === 'number' && groupFontScale !== 1 ? flattened.fontSize * groupFontScale : undefined;
|
|
14
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
15
|
+
style: [style, styles.base, scaledFontSize != null ? {
|
|
16
|
+
fontSize: scaledFontSize
|
|
17
|
+
} : null],
|
|
18
|
+
numberOfLines: 1,
|
|
19
|
+
adjustsFontSizeToFit: true,
|
|
20
|
+
minimumFontScale: minimumFontScale,
|
|
21
|
+
ellipsizeMode: "tail",
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const styles = StyleSheet.create({
|
|
26
|
+
base: {
|
|
27
|
+
flexShrink: 1,
|
|
28
|
+
textTransform: 'uppercase'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export default WorkflowButtonLabel;
|
|
32
|
+
//# sourceMappingURL=WorkflowButtonLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","jsx","_jsx","WorkflowButtonLabel","children","style","minimumFontScale","groupFontScale","flattened","flatten","scaledFontSize","fontSize","undefined","styles","base","numberOfLines","adjustsFontSizeToFit","ellipsizeMode","create","flexShrink","textTransform"],"sourceRoot":"../../../src","sources":["components/WorkflowButtonLabel.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,UAAU,EAAEC,IAAI,QAAwB,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAY/E,MAAMC,mBAAuD,GAAGA,CAAC;EAC/DC,QAAQ;EACRC,KAAK;EACLC,gBAAgB,GAAG,IAAI;EACvBC,cAAc,GAAG;AACnB,CAAC,KAAK;EACJ,MAAMC,SAAS,GAAGT,UAAU,CAACU,OAAO,CAACJ,KAAK,CAA0B;EACpE,MAAMK,cAAc,GAClB,OAAOF,SAAS,EAAEG,QAAQ,KAAK,QAAQ,IAAIJ,cAAc,KAAK,CAAC,GAAGC,SAAS,CAACG,QAAQ,GAAGJ,cAAc,GAAGK,SAAS;EAEnH,oBACEV,IAAA,CAACF,IAAI;IACHK,KAAK,EAAE,CAACA,KAAK,EAAEQ,MAAM,CAACC,IAAI,EAAEJ,cAAc,IAAI,IAAI,GAAG;MAAEC,QAAQ,EAAED;IAAe,CAAC,GAAG,IAAI,CAAE;IAC1FK,aAAa,EAAE,CAAE;IACjBC,oBAAoB;IACpBV,gBAAgB,EAAEA,gBAAiB;IACnCW,aAAa,EAAC,MAAM;IAAAb,QAAA,EAEnBA;EAAQ,CACL,CAAC;AAEX,CAAC;AAED,MAAMS,MAAM,GAAGd,UAAU,CAACmB,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IAAEK,UAAU,EAAE,CAAC;IAAEC,aAAa,EAAE;EAAY;AACpD,CAAC,CAAC;AAEF,eAAejB,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import Svg, { Line, Path, Rect } from 'react-native-svg';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const WorkflowCalendarIcon = ({
|
|
7
|
+
kind,
|
|
8
|
+
size = 18,
|
|
9
|
+
color = '#FFFFFF'
|
|
10
|
+
}) => {
|
|
11
|
+
return /*#__PURE__*/_jsxs(Svg, {
|
|
12
|
+
width: size,
|
|
13
|
+
height: size,
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
children: [/*#__PURE__*/_jsx(Rect, {
|
|
17
|
+
x: "3.5",
|
|
18
|
+
y: "5",
|
|
19
|
+
width: "17",
|
|
20
|
+
height: "15.5",
|
|
21
|
+
rx: "2.5",
|
|
22
|
+
stroke: color,
|
|
23
|
+
strokeWidth: 1.6
|
|
24
|
+
}), /*#__PURE__*/_jsx(Line, {
|
|
25
|
+
x1: "3.5",
|
|
26
|
+
y1: "9.25",
|
|
27
|
+
x2: "20.5",
|
|
28
|
+
y2: "9.25",
|
|
29
|
+
stroke: color,
|
|
30
|
+
strokeWidth: 1.6
|
|
31
|
+
}), /*#__PURE__*/_jsx(Line, {
|
|
32
|
+
x1: "8",
|
|
33
|
+
y1: "3.5",
|
|
34
|
+
x2: "8",
|
|
35
|
+
y2: "6.5",
|
|
36
|
+
stroke: color,
|
|
37
|
+
strokeWidth: 1.6,
|
|
38
|
+
strokeLinecap: "round"
|
|
39
|
+
}), /*#__PURE__*/_jsx(Line, {
|
|
40
|
+
x1: "16",
|
|
41
|
+
y1: "3.5",
|
|
42
|
+
x2: "16",
|
|
43
|
+
y2: "6.5",
|
|
44
|
+
stroke: color,
|
|
45
|
+
strokeWidth: 1.6,
|
|
46
|
+
strokeLinecap: "round"
|
|
47
|
+
}), kind === 'plus' ? /*#__PURE__*/_jsx(Path, {
|
|
48
|
+
d: "M16.2 14.2h2.6M17.5 12.9v2.6",
|
|
49
|
+
stroke: color,
|
|
50
|
+
strokeWidth: 1.7,
|
|
51
|
+
strokeLinecap: "round"
|
|
52
|
+
}) : /*#__PURE__*/_jsx(Path, {
|
|
53
|
+
d: "M14.8 15.1l1.35 1.35 2.55-2.7",
|
|
54
|
+
stroke: color,
|
|
55
|
+
strokeWidth: 1.7,
|
|
56
|
+
strokeLinecap: "round",
|
|
57
|
+
strokeLinejoin: "round"
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
export function resolveCalendarIconKind(icon) {
|
|
62
|
+
if (!icon) return null;
|
|
63
|
+
const key = icon.trim().toLowerCase();
|
|
64
|
+
if (key === 'calendar-plus' || key === 'calendar_plus' || key === 'calendar+' || key === '📅+' || key === '📅') {
|
|
65
|
+
return 'plus';
|
|
66
|
+
}
|
|
67
|
+
if (key === 'calendar-check' || key === 'calendar_check' || key === 'calendar-checkin' || key === '✓' || key === '📅✓') {
|
|
68
|
+
return 'check';
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
export default WorkflowCalendarIcon;
|
|
73
|
+
//# sourceMappingURL=WorkflowCalendarIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Svg","Line","Path","Rect","jsx","_jsx","jsxs","_jsxs","WorkflowCalendarIcon","kind","size","color","width","height","viewBox","fill","children","x","y","rx","stroke","strokeWidth","x1","y1","x2","y2","strokeLinecap","d","strokeLinejoin","resolveCalendarIconKind","icon","key","trim","toLowerCase"],"sourceRoot":"../../../src","sources":["components/WorkflowCalendarIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUxD,MAAMC,oBAAyD,GAAGA,CAAC;EAAEC,IAAI;EAAEC,IAAI,GAAG,EAAE;EAAEC,KAAK,GAAG;AAAU,CAAC,KAAK;EAC5G,oBACEJ,KAAA,CAACP,GAAG;IAACY,KAAK,EAAEF,IAAK;IAACG,MAAM,EAAEH,IAAK;IAACI,OAAO,EAAC,WA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uBAAuBA,CAACC,IAAa,EAAmC;EACtF,IAAI,CAACA,IAAI,EAAE,OAAO,IAAI;EACtB,MAAMC,GAAG,GAAGD,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;EACrC,IAAIF,GAAG,KAAK,eAAe,IAAIA,GAAG,KAAK,eAAe,IAAIA,GAAG,KAAK,WAAW,IAAIA,GAAG,KAAK,KAAK,IAAIA,GAAG,KAAK,IAAI,EAAE;IAC9G,OAAO,MAAM;EACf;EACA,IACEA,GAAG,KAAK,gBAAgB,IACxBA,GAAG,KAAK,gBAAgB,IACxBA,GAAG,KAAK,kBAAkB,IAC1BA,GAAG,KAAK,GAAG,IACXA,GAAG,KAAK,KAAK,EACb;IACA,OAAO,OAAO;EAChB;EACA,OAAO,IAAI;AACb;AAEA,eAAevB,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { StyleSheet, Text } from 'react-native';
|
|
5
|
+
import { useResponsive } from "../responsive/index.js";
|
|
6
|
+
import { estimateGroupButtonScale } from "../responsive/responsive.js";
|
|
7
|
+
import { useRegisterTitleGroupScale, useWorkflowTitleScale } from "../WorkflowFontScaleContext.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export const WORKFLOW_TEXT_BASE_SIZES = {
|
|
10
|
+
heading: 18,
|
|
11
|
+
title: 15,
|
|
12
|
+
subtitle: 12,
|
|
13
|
+
body: 15,
|
|
14
|
+
label: 14,
|
|
15
|
+
caption: 12,
|
|
16
|
+
badge: 11
|
|
17
|
+
};
|
|
18
|
+
const FONT_WEIGHTS = {
|
|
19
|
+
heading: '700',
|
|
20
|
+
title: '600',
|
|
21
|
+
subtitle: '400',
|
|
22
|
+
body: '400',
|
|
23
|
+
label: '600',
|
|
24
|
+
caption: '400',
|
|
25
|
+
badge: '600'
|
|
26
|
+
};
|
|
27
|
+
const BODY_VARIANTS = new Set(['subtitle', 'body', 'label', 'caption']);
|
|
28
|
+
|
|
29
|
+
// Variants that sync to one shared size across the whole screen, regardless
|
|
30
|
+
// of which component (card, tile, standalone title block...) renders them.
|
|
31
|
+
// Every instance measures its own rendered width and reports the scale IT
|
|
32
|
+
// needs to fit on one line; the registry then broadcasts the smallest of all
|
|
33
|
+
// of them back out, so e.g. every 'title' on screen always matches.
|
|
34
|
+
const SYNCED_VARIANTS = new Set(['title']);
|
|
35
|
+
const WorkflowText = ({
|
|
36
|
+
variant = 'body',
|
|
37
|
+
size,
|
|
38
|
+
style,
|
|
39
|
+
children,
|
|
40
|
+
numberOfLines,
|
|
41
|
+
minimumFontScale,
|
|
42
|
+
onLayout,
|
|
43
|
+
...rest
|
|
44
|
+
}) => {
|
|
45
|
+
const {
|
|
46
|
+
ms
|
|
47
|
+
} = useResponsive();
|
|
48
|
+
const screenTitleScale = useWorkflowTitleScale();
|
|
49
|
+
const fitOneLine = numberOfLines === 1;
|
|
50
|
+
const isSynced = SYNCED_VARIANTS.has(variant) && fitOneLine;
|
|
51
|
+
const resolvedMinScale = minimumFontScale ?? (BODY_VARIANTS.has(variant) ? 0.65 : 0.85);
|
|
52
|
+
const instanceIdRef = useRef(`wtxt-${Math.random().toString(36).slice(2)}`);
|
|
53
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
54
|
+
const baseFontSize = useMemo(() => {
|
|
55
|
+
const flattened = StyleSheet.flatten(style);
|
|
56
|
+
const styleSize = flattened && typeof flattened.fontSize === 'number' && Number.isFinite(flattened.fontSize) ? flattened.fontSize : undefined;
|
|
57
|
+
if (size != null) return ms(size);
|
|
58
|
+
if (styleSize != null) return styleSize;
|
|
59
|
+
return ms(WORKFLOW_TEXT_BASE_SIZES[variant]);
|
|
60
|
+
}, [ms, size, style, variant]);
|
|
61
|
+
const text = typeof children === 'string' ? children : String(children ?? '');
|
|
62
|
+
const requiredScale = useMemo(() => {
|
|
63
|
+
if (!isSynced || containerWidth <= 0 || text.length === 0) return 1;
|
|
64
|
+
return estimateGroupButtonScale([text], containerWidth, baseFontSize);
|
|
65
|
+
}, [isSynced, containerWidth, text, baseFontSize]);
|
|
66
|
+
useRegisterTitleGroupScale(instanceIdRef.current, isSynced ? requiredScale : 1);
|
|
67
|
+
const handleLayout = useCallback(event => {
|
|
68
|
+
if (isSynced) {
|
|
69
|
+
const next = event.nativeEvent.layout.width;
|
|
70
|
+
setContainerWidth(prev => Math.abs(prev - next) > 1 ? next : prev);
|
|
71
|
+
}
|
|
72
|
+
onLayout?.(event);
|
|
73
|
+
}, [isSynced, onLayout]);
|
|
74
|
+
const fontSize = baseFontSize * (isSynced ? screenTitleScale : 1);
|
|
75
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
76
|
+
...rest,
|
|
77
|
+
onLayout: handleLayout,
|
|
78
|
+
numberOfLines: numberOfLines,
|
|
79
|
+
adjustsFontSizeToFit: fitOneLine,
|
|
80
|
+
minimumFontScale: fitOneLine ? resolvedMinScale : undefined,
|
|
81
|
+
ellipsizeMode: fitOneLine ? 'tail' : undefined,
|
|
82
|
+
style: [{
|
|
83
|
+
fontWeight: FONT_WEIGHTS[variant],
|
|
84
|
+
flexShrink: 1
|
|
85
|
+
}, style, {
|
|
86
|
+
fontSize
|
|
87
|
+
}],
|
|
88
|
+
children: children
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
export default WorkflowText;
|
|
92
|
+
//# sourceMappingURL=WorkflowText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useRef","useState","StyleSheet","Text","useResponsive","estimateGroupButtonScale","useRegisterTitleGroupScale","useWorkflowTitleScale","jsx","_jsx","WORKFLOW_TEXT_BASE_SIZES","heading","title","subtitle","body","label","caption","badge","FONT_WEIGHTS","BODY_VARIANTS","Set","SYNCED_VARIANTS","WorkflowText","variant","size","style","children","numberOfLines","minimumFontScale","onLayout","rest","ms","screenTitleScale","fitOneLine","isSynced","has","resolvedMinScale","instanceIdRef","Math","random","toString","slice","containerWidth","setContainerWidth","baseFontSize","flattened","flatten","styleSize","fontSize","Number","isFinite","undefined","text","String","requiredScale","length","current","handleLayout","event","next","nativeEvent","layout","width","prev","abs","adjustsFontSizeToFit","ellipsizeMode","fontWeight","flexShrink"],"sourceRoot":"../../../src","sources":["components/WorkflowText.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SAAiDC,UAAU,EAAEC,IAAI,QAAwC,cAAc;AAEvH,SAASC,aAAa,QAAQ,wBAAe;AAC7C,SAASC,wBAAwB,QAAQ,6BAA0B;AACnE,SAASC,0BAA0B,EAAEC,qBAAqB,QAAQ,gCAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAW/F,OAAO,MAAMC,wBAA6D,GAAG;EAC3EC,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE,EAAE;EACTC,QAAQ,EAAE,EAAE;EACZC,IAAI,EAAE,EAAE;EACRC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE,EAAE;EACXC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,YAAkE,GAAG;EACzEP,OAAO,EAAE,KAAK;EACdC,KAAK,EAAE,KAAK;EACZC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE,KAAK;EACXC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,KAAK;EACdC,KAAK,EAAE;AACT,CAAC;AAED,MAAME,aAAa,GAAG,IAAIC,GAAG,CAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;;AAE5F;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAG,IAAID,GAAG,CAAsB,CAAC,OAAO,CAAC,CAAC;AAE/D,MAAME,YAAyC,GAAGA,CAAC;EACjDC,OAAO,GAAG,MAAM;EAChBC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AAEjC,UAAU,GAAG,MAAM,GAAGkB,SAAU;IAC/C1B,KAAK,EAAE,CACL;MACE0C,UAAU,EAAEjD,YAAY,CAACK,OAAO,CAAC;MACjC6C,UAAU,EAAE;IACd,CAAC,EACD3C,KAAK,EACL;MACEuB;IACF,CAAC,CACD;IAAAtB,QAAA,EAEDA;EAAQ,CACL,CAAC;AAEX,CAAC;AAED,eAAeJ,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { resolveSurfaceBackground } from "../style/resolveDisplayHintStyle.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const TONES = {
|
|
11
|
+
default: {
|
|
12
|
+
bg: '#e5e7eb',
|
|
13
|
+
fg: '#1f2937'
|
|
14
|
+
},
|
|
15
|
+
green: {
|
|
16
|
+
bg: '#dcfce7',
|
|
17
|
+
fg: '#166534'
|
|
18
|
+
},
|
|
19
|
+
red: {
|
|
20
|
+
bg: '#fee2e2',
|
|
21
|
+
fg: '#991b1b'
|
|
22
|
+
},
|
|
23
|
+
amber: {
|
|
24
|
+
bg: '#fef3c7',
|
|
25
|
+
fg: '#92400e'
|
|
26
|
+
},
|
|
27
|
+
blue: {
|
|
28
|
+
bg: '#dbeafe',
|
|
29
|
+
fg: '#1e3a8a'
|
|
30
|
+
},
|
|
31
|
+
purple: {
|
|
32
|
+
bg: '#ede9fe',
|
|
33
|
+
fg: '#5b21b6'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const BadgeContent = ({
|
|
37
|
+
item
|
|
38
|
+
}) => {
|
|
39
|
+
const {
|
|
40
|
+
s
|
|
41
|
+
} = useResponsive();
|
|
42
|
+
const label = item.label ?? item.text ?? '';
|
|
43
|
+
const tone = item.tone ?? 'default';
|
|
44
|
+
const palette = TONES[tone] ?? TONES.default;
|
|
45
|
+
const customBg = resolveSurfaceBackground(item.bgColor);
|
|
46
|
+
const hasCustomBg = customBg !== 'transparent';
|
|
47
|
+
const customFg = typeof item.color === 'string' && item.color.trim() ? item.color.trim() : hasCustomBg ? '#FFFFFF' : palette.fg;
|
|
48
|
+
const radius = typeof item.borderRadius === 'number' && Number.isFinite(item.borderRadius) ? item.borderRadius : s(6);
|
|
49
|
+
return /*#__PURE__*/_jsx(View, {
|
|
50
|
+
style: [{
|
|
51
|
+
alignSelf: item.align === 'center' ? 'center' : item.align === 'end' || item.align === 'right' ? 'flex-end' : 'flex-start',
|
|
52
|
+
maxWidth: '100%',
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
minWidth: typeof item.minWidth === 'number' ? item.minWidth : undefined,
|
|
55
|
+
borderRadius: radius,
|
|
56
|
+
backgroundColor: hasCustomBg ? customBg : palette.bg,
|
|
57
|
+
paddingHorizontal: s(12),
|
|
58
|
+
paddingVertical: s(5)
|
|
59
|
+
}],
|
|
60
|
+
children: /*#__PURE__*/_jsx(WorkflowText, {
|
|
61
|
+
variant: "badge",
|
|
62
|
+
numberOfLines: 1,
|
|
63
|
+
style: {
|
|
64
|
+
color: customFg,
|
|
65
|
+
fontWeight: '700'
|
|
66
|
+
},
|
|
67
|
+
children: label
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
ContentRegistry.register('badge', BadgeContent);
|
|
72
|
+
export default BadgeContent;
|
|
73
|
+
//# sourceMappingURL=BadgeContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","WorkflowText","ContentRegistry","useResponsive","resolveSurfaceBackground","jsx","_jsx","TONES","default","bg","fg","green","red","amber","blue","purple","BadgeContent","item","s","label","text","tone","palette","customBg","bgColor","hasCustomBg","customFg","color","trim","radius","borderRadius","Number","isFinite","style","alignSelf","align","maxWidth","flexShrink","minWidth","undefined","backgroundColor","paddingHorizontal","paddingVertical","children","variant","numberOfLines","fontWeight","register"],"sourceRoot":"../../../src","sources":["content/BadgeContent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,OAAOC,YAAY,MAAM,+BAA4B;AACrD,SAA4BC,eAAe,QAAQ,kCAA+B;AAClF,SAASC,aAAa,QAAQ,wBAAe;AAC7C,SAASC,wBAAwB,QAAQ,qCAAkC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE3E,MAAMC,KAAiD,GAAG;EACxDC,OAAO,EAAE;IAAEC,EAAE,EAAE,SAAS;IAAEC,EAAE,EAAE;EAAU,CAAC;EACzCC,KAAK,EAAE;IAAEF,EAAE,EAAE,SAAS;IAAEC,EAAE,EAAE;EAAU,CAAC;EACvCE,GAAG,EAAE;IAAEH,EAAE,EAAE,SAAS;IAAEC,EAAE,EAAE;EAAU,CAAC;EACrCG,KAAK,EAAE;IAAEJ,EAAE,EAAE,SAAS;IAAEC,EAAE,EAAE;EAAU,CAAC;EACvCI,IAAI,EAAE;IAAEL,EAAE,EAAE,SAAS;IAAEC,EAAE,EAAE;EAAU,CAAC;EACtCK,MAAM,EAAE;IAAEN,EAAE,EAAE,SAAS;IAAEC,EAAE,EAAE;EAAU;AACzC,CAAC;AAED,MAAMM,YAAoC,GAAGA,CAAC;EAAEC;AAAK,CAAC,KAAK;EACzD,MAAM;IAAEC;EAAE,CAAC,GAAGf,aAAa,CAAC,CAAC;EAC7B,MAAMgB,KAAK,GAAIF,IAAI,CAACE,KAAK,IAA4BF,IAAI,CAACG,IAA2B,IAAI,EAAE;EAC3F,MAAMC,IAAI,GAAIJ,IAAI,CAACI,IAAI,IAA2B,SAAS;EAC3D,MAAMC,OAAO,GAAGf,KAAK,CAACc,IAAI,CAAC,IAAId,KAAK,CAACC,OAAO;EAC5C,MAAM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E;MAAM,CAAE;MAAAH,QAAA,EAC3FxB;IAAK,CACM;EAAC,CACX,CAAC;AAEX,CAAC;AAEDjB,eAAe,CAAC6C,QAAQ,CAAC,OAAO,EAAE/B,YAAY,CAAC;AAE/C,eAAeA,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// packages/core/src/modules/workflow/ui-elements/content/BarChartContent.tsx
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Text, View } from 'react-native';
|
|
7
|
+
import { ContentRegistry } from "../registries/ContentRegistry.js";
|
|
8
|
+
import { resolveItemSurfaceStyle } from "../style/resolveDisplayHintStyle.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const parseCount = count => {
|
|
11
|
+
if (typeof count === 'number') return count;
|
|
12
|
+
return parseFloat(count) || 0;
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_BARS = [{
|
|
15
|
+
label: 'Category A',
|
|
16
|
+
count: 75
|
|
17
|
+
}, {
|
|
18
|
+
label: 'Category B',
|
|
19
|
+
count: 50
|
|
20
|
+
}, {
|
|
21
|
+
label: 'Category C',
|
|
22
|
+
count: 90
|
|
23
|
+
}, {
|
|
24
|
+
label: 'Category D',
|
|
25
|
+
count: 35
|
|
26
|
+
}];
|
|
27
|
+
const BarChartContent = ({
|
|
28
|
+
item,
|
|
29
|
+
styles,
|
|
30
|
+
colors
|
|
31
|
+
}) => {
|
|
32
|
+
const rawBars = item.bars || [];
|
|
33
|
+
const bars = rawBars.length > 0 ? rawBars : DEFAULT_BARS;
|
|
34
|
+
const parsedMax = item.max != null ? parseCount(item.max) : 0;
|
|
35
|
+
const maxCount = parsedMax > 0 ? parsedMax : Math.max(...bars.map(b => parseCount(b.count)), 1);
|
|
36
|
+
|
|
37
|
+
// Use the same colors as PieChart for consistency
|
|
38
|
+
const barColors = ['#FF6384', '#36A2EB', '#FFCE56', '#4BC0C0', '#9966FF', '#FF9F40'];
|
|
39
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
40
|
+
style: [styles.fieldContainer, resolveItemSurfaceStyle(item)],
|
|
41
|
+
children: [item.title && /*#__PURE__*/_jsx(Text, {
|
|
42
|
+
style: [styles.formLabel, {
|
|
43
|
+
color: colors.text,
|
|
44
|
+
marginBottom: 12
|
|
45
|
+
}],
|
|
46
|
+
children: item.title
|
|
47
|
+
}), bars.map((bar, index) => {
|
|
48
|
+
const count = parseCount(bar.count);
|
|
49
|
+
const percentage = Math.max(0, Math.min(count / maxCount * 100, 100));
|
|
50
|
+
const barColor = barColors[index % barColors.length];
|
|
51
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
52
|
+
style: {
|
|
53
|
+
marginBottom: 12
|
|
54
|
+
},
|
|
55
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
56
|
+
style: {
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
justifyContent: 'space-between',
|
|
59
|
+
marginBottom: 4
|
|
60
|
+
},
|
|
61
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
62
|
+
style: [styles.description, {
|
|
63
|
+
color: colors.text,
|
|
64
|
+
fontSize: 13
|
|
65
|
+
}],
|
|
66
|
+
children: bar.label
|
|
67
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
68
|
+
style: [styles.description, {
|
|
69
|
+
color: colors.text,
|
|
70
|
+
fontSize: 13,
|
|
71
|
+
fontWeight: '600'
|
|
72
|
+
}],
|
|
73
|
+
children: count
|
|
74
|
+
})]
|
|
75
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
76
|
+
style: {
|
|
77
|
+
height: 24,
|
|
78
|
+
backgroundColor: `${barColor}20`,
|
|
79
|
+
// Light background with 20% opacity
|
|
80
|
+
borderRadius: 4,
|
|
81
|
+
overflow: 'hidden'
|
|
82
|
+
},
|
|
83
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
84
|
+
style: {
|
|
85
|
+
height: '100%',
|
|
86
|
+
width: `${percentage}%`,
|
|
87
|
+
backgroundColor: barColor // Solid color for the bar
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
})]
|
|
91
|
+
}, index);
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
ContentRegistry.register('bar-chart', BarChartContent);
|
|
96
|
+
export default BarChartContent;
|
|
97
|
+
//# sourceMappingURL=BarChartContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","View","ContentRegistry","resolveItemSurfaceStyle","jsx","_jsx","jsxs","_jsxs","parseCount","count","parseFloat","DEFAULT_BARS","label","BarChartContent","item","styles","colors","rawBars","bars","length","parsedMax","max","maxCount","Math","map","b","barColors","style","fieldContainer","children","title","formLabel","color","text","marginBottom","bar","index","percentage","min","barColor","flexDirection","justifyContent","description","fontSize","fontWeight","height","backgroundColor","borderRadius","overflow","width","register"],"sourceRoot":"../../../src","sources":["content/BarChartContent.tsx"],"mappings":";;AAAA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAA4BC,eAAe,QAAQ,kCAA+B;AAClF,SAASC,uBAAuB,QAAQ,qCAAkC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAO1E,MAAMC,UAAU,GAAIC,KAAsB,IAAa;EACrD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAC3C,OAAOC,UAAU,CAACD,KAAK,CAAC,IAAI,CAAC;AAC/B,CAAC;AAED,MAAME,YAAuB,GAAG,CAC9B;EAAEC,KAAK,EAAE,YAAY;EAAEH,KAAK,EAAE;AAAG,CAAC,EAClC;EAAEG,KAAK,EAAE,YAAY;EAAEH,KAAK,EAAE;AAAG,CAAC,EAClC;EAAEG,KAAK,EAAE,YAAY;EAAEH,KAAK,EAAE;AAAG,C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Ae,EAAEP,QAAQ,CAAE;YAC7B;UAAE,CACH;QAAC,CACE,CAAC;MAAA,GArBEH,KAsBL,CAAC;IAEX,CAAC,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAEDlC,eAAe,CAACgD,QAAQ,CAAC,WAAW,EAAErC,eAAe,CAAC;AAEtD,eAAeA,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { useWalletAdapter } from "../adapter/WalletAdapter.js";
|
|
6
|
+
import { useWorkflowT } from "../i18n/WorkflowI18n.js";
|
|
7
|
+
import { WorkflowIcon } from "../icons/WorkflowIcon.js";
|
|
8
|
+
import { ContentRegistry } from "../registries/ContentRegistry.js";
|
|
9
|
+
import { resolveItemSurfaceStyle } from "../style/resolveDisplayHintStyle.js";
|
|
10
|
+
import { testIdWithKey } from "../utils/testable.js";
|
|
11
|
+
import { local } from "./PhotoContent.js";
|
|
12
|
+
import { SimulatedHint } from "./SimulatedHint.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* QR / barcode scan button. Scanning is the app's (`adapter.scanBarcode()`):
|
|
16
|
+
* the wallet opens its scanner screen (which handles the code itself and
|
|
17
|
+
* resolves `null`); the designer returns a sample code. A returned code goes
|
|
18
|
+
* to `form-id` and to `actionID` / `event` as `{ code }`.
|
|
19
|
+
*/
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
const BarcodeContent = ({
|
|
22
|
+
item,
|
|
23
|
+
styles,
|
|
24
|
+
colors,
|
|
25
|
+
onAction,
|
|
26
|
+
onFieldChange,
|
|
27
|
+
disabled
|
|
28
|
+
}) => {
|
|
29
|
+
const t = useWorkflowT();
|
|
30
|
+
const adapter = useWalletAdapter();
|
|
31
|
+
const label = typeof item.label === 'string' && item.label || t('WorkflowUi.ScanCode');
|
|
32
|
+
const formId = item['form-id'];
|
|
33
|
+
const actionId = item.actionID || item.event;
|
|
34
|
+
const handlePress = async () => {
|
|
35
|
+
if (disabled) return;
|
|
36
|
+
try {
|
|
37
|
+
const code = await adapter.scanBarcode();
|
|
38
|
+
if (!code) return;
|
|
39
|
+
if (formId) onFieldChange?.(formId, code);
|
|
40
|
+
if (actionId) onAction(actionId, {
|
|
41
|
+
code
|
|
42
|
+
});
|
|
43
|
+
} catch {
|
|
44
|
+
// the scanner reports its own errors
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
48
|
+
style: [styles.fieldContainer, resolveItemSurfaceStyle(item)],
|
|
49
|
+
children: [item.label ? /*#__PURE__*/_jsx(Text, {
|
|
50
|
+
style: [styles.label, {
|
|
51
|
+
color: colors.text
|
|
52
|
+
}],
|
|
53
|
+
children: label
|
|
54
|
+
}) : null, /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
55
|
+
testID: testIdWithKey('WorkflowScanCode'),
|
|
56
|
+
accessibilityLabel: label,
|
|
57
|
+
accessibilityRole: "button",
|
|
58
|
+
onPress: handlePress,
|
|
59
|
+
activeOpacity: 0.8,
|
|
60
|
+
style: [local.dashedButton, {
|
|
61
|
+
borderColor: colors.border
|
|
62
|
+
}, disabled ? local.disabled : null],
|
|
63
|
+
children: [/*#__PURE__*/_jsx(WorkflowIcon, {
|
|
64
|
+
set: "material-community",
|
|
65
|
+
name: "qrcode-scan",
|
|
66
|
+
size: 32,
|
|
67
|
+
color: "#FFFFFF"
|
|
68
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
69
|
+
style: local.dashedLabel,
|
|
70
|
+
children: label
|
|
71
|
+
})]
|
|
72
|
+
}), adapter.simulated ? /*#__PURE__*/_jsx(SimulatedHint, {}) : null]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
ContentRegistry.register('barcode', BarcodeContent);
|
|
76
|
+
ContentRegistry.register('qr-code', BarcodeContent);
|
|
77
|
+
export default BarcodeContent;
|
|
78
|
+
//# sourceMappingURL=BarcodeContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","TouchableOpacity","View","useWalletAdapter","useWorkflowT","WorkflowIcon","ContentRegistry","resolveItemSurfaceStyle","testIdWithKey","local","SimulatedHint","jsx","_jsx","jsxs","_jsxs","BarcodeContent","item","styles","colors","onAction","onFieldChange","disabled","t","adapter","label","formId","actionId","actionID","event","handlePress","code","scanBarcode","style","fieldContainer","children","color","text","testID","accessibilityLabel","accessibilityRole","onPress","activeOpacity","dashedButton","borderColor","border","set","name","size","dashedLabel","simulated","register"],"sourceRoot":"../../../src","sources":["content/BarcodeContent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC3D,SAASC,gBAAgB,QAAQ,6BAA0B;AAC3D,SAASC,YAAY,QAAQ,yBAAsB;AACnD,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAA4BC,eAAe,QAAQ,kCAA+B;AAClF,SAASC,uBAAuB,QAAQ,qCAAkC;AAC1E,SAASC,aAAa,QAAQ,sBAAmB;AACjD,SAASC,KAAK,QAAQ,mBAAgB;AACtC,SAASC,aAAa,QAAQ,oBAAiB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMA,MAAMC,cAAsC,GAAGA,CAAC;EAAEC,IAAI;EAAEC,MAAM;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,aAAa;EAAEC;AAAS,CAAC,KAAK;EAC9G,MAAMC,CAAC,GAAGlB,YAAY,CAAC,CAAC;EACxB,MAAMmB,OAAO,GAAGpB,gBAAgB,CAAC,CAAC;EAClC,MAAMqB,KAAK,GAAI,OAAOR,IAAI,CAACQ,KAAK,KAAK,QAAQ,IAAIR,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