@veridid/workflow-ui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +217 -2
  3. package/build/module/WorkflowFontScaleContext.js +67 -0
  4. package/build/module/WorkflowFontScaleContext.js.map +1 -0
  5. package/build/module/adapter/WalletAdapter.js +152 -0
  6. package/build/module/adapter/WalletAdapter.js.map +1 -0
  7. package/build/module/components/FallbackVideoPlayer.js +8 -0
  8. package/build/module/components/FallbackVideoPlayer.js.map +1 -0
  9. package/build/module/components/FallbackVideoPlayer.native.js +10 -0
  10. package/build/module/components/FallbackVideoPlayer.native.js.map +1 -0
  11. package/build/module/components/FallbackVideoPlayer.web.js +35 -0
  12. package/build/module/components/FallbackVideoPlayer.web.js.map +1 -0
  13. package/build/module/components/WorkflowButtonLabel.js +32 -0
  14. package/build/module/components/WorkflowButtonLabel.js.map +1 -0
  15. package/build/module/components/WorkflowCalendarIcon.js +73 -0
  16. package/build/module/components/WorkflowCalendarIcon.js.map +1 -0
  17. package/build/module/components/WorkflowText.js +92 -0
  18. package/build/module/components/WorkflowText.js.map +1 -0
  19. package/build/module/content/BadgeContent.js +73 -0
  20. package/build/module/content/BadgeContent.js.map +1 -0
  21. package/build/module/content/BarChartContent.js +97 -0
  22. package/build/module/content/BarChartContent.js.map +1 -0
  23. package/build/module/content/BarcodeContent.js +78 -0
  24. package/build/module/content/BarcodeContent.js.map +1 -0
  25. package/build/module/content/BasicTableContent.js +145 -0
  26. package/build/module/content/BasicTableContent.js.map +1 -0
  27. package/build/module/content/ButtonContent.js +130 -0
  28. package/build/module/content/ButtonContent.js.map +1 -0
  29. package/build/module/content/CalendarContent.js +173 -0
  30. package/build/module/content/CalendarContent.js.map +1 -0
  31. package/build/module/content/CardContent.js +114 -0
  32. package/build/module/content/CardContent.js.map +1 -0
  33. package/build/module/content/CarouselContent.js +173 -0
  34. package/build/module/content/CarouselContent.js.map +1 -0
  35. package/build/module/content/ChipContent.js +214 -0
  36. package/build/module/content/ChipContent.js.map +1 -0
  37. package/build/module/content/ChipRowContent.js +127 -0
  38. package/build/module/content/ChipRowContent.js.map +1 -0
  39. package/build/module/content/CredentialOfferContent.js +312 -0
  40. package/build/module/content/CredentialOfferContent.js.map +1 -0
  41. package/build/module/content/DialContent.js +101 -0
  42. package/build/module/content/DialContent.js.map +1 -0
  43. package/build/module/content/DividerContent.js +26 -0
  44. package/build/module/content/DividerContent.js.map +1 -0
  45. package/build/module/content/DonutChartContent.js +118 -0
  46. package/build/module/content/DonutChartContent.js.map +1 -0
  47. package/build/module/content/FormContent.js +141 -0
  48. package/build/module/content/FormContent.js.map +1 -0
  49. package/build/module/content/FormFieldBridge.js +157 -0
  50. package/build/module/content/FormFieldBridge.js.map +1 -0
  51. package/build/module/content/GaugeContent.js +77 -0
  52. package/build/module/content/GaugeContent.js.map +1 -0
  53. package/build/module/content/GridLayoutContent.js +227 -0
  54. package/build/module/content/GridLayoutContent.js.map +1 -0
  55. package/build/module/content/ImageContent.js +190 -0
  56. package/build/module/content/ImageContent.js.map +1 -0
  57. package/build/module/content/ListContent.js +121 -0
  58. package/build/module/content/ListContent.js.map +1 -0
  59. package/build/module/content/LocationContent.js +148 -0
  60. package/build/module/content/LocationContent.js.map +1 -0
  61. package/build/module/content/MapContent.js +213 -0
  62. package/build/module/content/MapContent.js.map +1 -0
  63. package/build/module/content/MultipleChoiceContent.js +91 -0
  64. package/build/module/content/MultipleChoiceContent.js.map +1 -0
  65. package/build/module/content/OpenBadgePreviewContent.js +141 -0
  66. package/build/module/content/OpenBadgePreviewContent.js.map +1 -0
  67. package/build/module/content/PhotoContent.js +154 -0
  68. package/build/module/content/PhotoContent.js.map +1 -0
  69. package/build/module/content/PieChartContent.js +129 -0
  70. package/build/module/content/PieChartContent.js.map +1 -0
  71. package/build/module/content/ProofPresentationContent.js +154 -0
  72. package/build/module/content/ProofPresentationContent.js.map +1 -0
  73. package/build/module/content/RadioButtonContent.js +136 -0
  74. package/build/module/content/RadioButtonContent.js.map +1 -0
  75. package/build/module/content/RowContent.js +539 -0
  76. package/build/module/content/RowContent.js.map +1 -0
  77. package/build/module/content/SectionContent.js +123 -0
  78. package/build/module/content/SectionContent.js.map +1 -0
  79. package/build/module/content/ShareEntryContent.js +111 -0
  80. package/build/module/content/ShareEntryContent.js.map +1 -0
  81. package/build/module/content/SimulatedHint.js +33 -0
  82. package/build/module/content/SimulatedHint.js.map +1 -0
  83. package/build/module/content/SliderContent.js +46 -0
  84. package/build/module/content/SliderContent.js.map +1 -0
  85. package/build/module/content/SpacerContent.js +21 -0
  86. package/build/module/content/SpacerContent.js.map +1 -0
  87. package/build/module/content/SpinnerContent.js +33 -0
  88. package/build/module/content/SpinnerContent.js.map +1 -0
  89. package/build/module/content/SubmitButtonContent.js +281 -0
  90. package/build/module/content/SubmitButtonContent.js.map +1 -0
  91. package/build/module/content/TextContent.js +127 -0
  92. package/build/module/content/TextContent.js.map +1 -0
  93. package/build/module/content/TileContent.js +237 -0
  94. package/build/module/content/TileContent.js.map +1 -0
  95. package/build/module/content/TimelineContent.js +120 -0
  96. package/build/module/content/TimelineContent.js.map +1 -0
  97. package/build/module/content/TitleContent.js +55 -0
  98. package/build/module/content/TitleContent.js.map +1 -0
  99. package/build/module/content/VideoContent.js +142 -0
  100. package/build/module/content/VideoContent.js.map +1 -0
  101. package/build/module/content/WebLinkContent.js +95 -0
  102. package/build/module/content/WebLinkContent.js.map +1 -0
  103. package/build/module/content/index.js +48 -0
  104. package/build/module/content/index.js.map +1 -0
  105. package/build/module/form-fields/CheckboxField.js +47 -0
  106. package/build/module/form-fields/CheckboxField.js.map +1 -0
  107. package/build/module/form-fields/DateField.js +8 -0
  108. package/build/module/form-fields/DateField.js.map +1 -0
  109. package/build/module/form-fields/DateField.native.js +141 -0
  110. package/build/module/form-fields/DateField.native.js.map +1 -0
  111. package/build/module/form-fields/DateField.web.js +45 -0
  112. package/build/module/form-fields/DateField.web.js.map +1 -0
  113. package/build/module/form-fields/DropdownField.js +172 -0
  114. package/build/module/form-fields/DropdownField.js.map +1 -0
  115. package/build/module/form-fields/MCQField.js +100 -0
  116. package/build/module/form-fields/MCQField.js.map +1 -0
  117. package/build/module/form-fields/RadioField.js +56 -0
  118. package/build/module/form-fields/RadioField.js.map +1 -0
  119. package/build/module/form-fields/SliderField.js +8 -0
  120. package/build/module/form-fields/SliderField.js.map +1 -0
  121. package/build/module/form-fields/SliderField.native.js +77 -0
  122. package/build/module/form-fields/SliderField.native.js.map +1 -0
  123. package/build/module/form-fields/SliderField.web.js +82 -0
  124. package/build/module/form-fields/SliderField.web.js.map +1 -0
  125. package/build/module/form-fields/SubmitButtonField.js +42 -0
  126. package/build/module/form-fields/SubmitButtonField.js.map +1 -0
  127. package/build/module/form-fields/TextField.js +56 -0
  128. package/build/module/form-fields/TextField.js.map +1 -0
  129. package/build/module/form-fields/index.js +15 -0
  130. package/build/module/form-fields/index.js.map +1 -0
  131. package/build/module/i18n/WorkflowI18n.js +94 -0
  132. package/build/module/i18n/WorkflowI18n.js.map +1 -0
  133. package/build/module/icons/VectorIcon.js +23 -0
  134. package/build/module/icons/VectorIcon.js.map +1 -0
  135. package/build/module/icons/VectorIcon.web.js +62 -0
  136. package/build/module/icons/VectorIcon.web.js.map +1 -0
  137. package/build/module/icons/WorkflowIcon.js +36 -0
  138. package/build/module/icons/WorkflowIcon.js.map +1 -0
  139. package/build/module/icons/types.js +4 -0
  140. package/build/module/icons/types.js.map +1 -0
  141. package/build/module/imageUriCache.js +25 -0
  142. package/build/module/imageUriCache.js.map +1 -0
  143. package/build/module/index.js +50 -0
  144. package/build/module/index.js.map +1 -0
  145. package/build/module/modal/WorkflowModal.js +115 -0
  146. package/build/module/modal/WorkflowModal.js.map +1 -0
  147. package/build/module/package.json +1 -0
  148. package/build/module/platform/platformName.js +10 -0
  149. package/build/module/platform/platformName.js.map +1 -0
  150. package/build/module/platform/platformName.web.js +5 -0
  151. package/build/module/platform/platformName.web.js.map +1 -0
  152. package/build/module/protocol/controlSnapshotStore.js +19 -0
  153. package/build/module/protocol/controlSnapshotStore.js.map +1 -0
  154. package/build/module/protocol/useProtocolExchange.js +168 -0
  155. package/build/module/protocol/useProtocolExchange.js.map +1 -0
  156. package/build/module/registries/ContentRegistry.js +53 -0
  157. package/build/module/registries/ContentRegistry.js.map +1 -0
  158. package/build/module/registries/FormFieldRegistry.js +56 -0
  159. package/build/module/registries/FormFieldRegistry.js.map +1 -0
  160. package/build/module/render/NodeBoundary.js +73 -0
  161. package/build/module/render/NodeBoundary.js.map +1 -0
  162. package/build/module/render/RenderTree.js +52 -0
  163. package/build/module/render/RenderTree.js.map +1 -0
  164. package/build/module/render/WorkflowRenderContext.js +34 -0
  165. package/build/module/render/WorkflowRenderContext.js.map +1 -0
  166. package/build/module/render/nodes.js +103 -0
  167. package/build/module/render/nodes.js.map +1 -0
  168. package/build/module/responsive/ResponsiveProvider.js +63 -0
  169. package/build/module/responsive/ResponsiveProvider.js.map +1 -0
  170. package/build/module/responsive/index.js +4 -0
  171. package/build/module/responsive/index.js.map +1 -0
  172. package/build/module/responsive/responsive.js +56 -0
  173. package/build/module/responsive/responsive.js.map +1 -0
  174. package/build/module/style/resolveDisplayHintStyle.js +145 -0
  175. package/build/module/style/resolveDisplayHintStyle.js.map +1 -0
  176. package/build/module/theme/WorkflowTheme.js +200 -0
  177. package/build/module/theme/WorkflowTheme.js.map +1 -0
  178. package/build/module/utils/testable.js +12 -0
  179. package/build/module/utils/testable.js.map +1 -0
  180. package/build/typescript/WorkflowFontScaleContext.d.ts +7 -0
  181. package/build/typescript/WorkflowFontScaleContext.d.ts.map +1 -0
  182. package/build/typescript/adapter/WalletAdapter.d.ts +145 -0
  183. package/build/typescript/adapter/WalletAdapter.d.ts.map +1 -0
  184. package/build/typescript/components/FallbackVideoPlayer.d.ts +6 -0
  185. package/build/typescript/components/FallbackVideoPlayer.d.ts.map +1 -0
  186. package/build/typescript/components/FallbackVideoPlayer.native.d.ts +7 -0
  187. package/build/typescript/components/FallbackVideoPlayer.native.d.ts.map +1 -0
  188. package/build/typescript/components/FallbackVideoPlayer.web.d.ts +9 -0
  189. package/build/typescript/components/FallbackVideoPlayer.web.d.ts.map +1 -0
  190. package/build/typescript/components/WorkflowButtonLabel.d.ts +11 -0
  191. package/build/typescript/components/WorkflowButtonLabel.d.ts.map +1 -0
  192. package/build/typescript/components/WorkflowCalendarIcon.d.ts +11 -0
  193. package/build/typescript/components/WorkflowCalendarIcon.d.ts.map +1 -0
  194. package/build/typescript/components/WorkflowText.d.ts +13 -0
  195. package/build/typescript/components/WorkflowText.d.ts.map +1 -0
  196. package/build/typescript/content/BadgeContent.d.ts +5 -0
  197. package/build/typescript/content/BadgeContent.d.ts.map +1 -0
  198. package/build/typescript/content/BarChartContent.d.ts +5 -0
  199. package/build/typescript/content/BarChartContent.d.ts.map +1 -0
  200. package/build/typescript/content/BarcodeContent.d.ts +11 -0
  201. package/build/typescript/content/BarcodeContent.d.ts.map +1 -0
  202. package/build/typescript/content/BasicTableContent.d.ts +5 -0
  203. package/build/typescript/content/BasicTableContent.d.ts.map +1 -0
  204. package/build/typescript/content/ButtonContent.d.ts +5 -0
  205. package/build/typescript/content/ButtonContent.d.ts.map +1 -0
  206. package/build/typescript/content/CalendarContent.d.ts +19 -0
  207. package/build/typescript/content/CalendarContent.d.ts.map +1 -0
  208. package/build/typescript/content/CardContent.d.ts +5 -0
  209. package/build/typescript/content/CardContent.d.ts.map +1 -0
  210. package/build/typescript/content/CarouselContent.d.ts +5 -0
  211. package/build/typescript/content/CarouselContent.d.ts.map +1 -0
  212. package/build/typescript/content/ChipContent.d.ts +5 -0
  213. package/build/typescript/content/ChipContent.d.ts.map +1 -0
  214. package/build/typescript/content/ChipRowContent.d.ts +8 -0
  215. package/build/typescript/content/ChipRowContent.d.ts.map +1 -0
  216. package/build/typescript/content/CredentialOfferContent.d.ts +98 -0
  217. package/build/typescript/content/CredentialOfferContent.d.ts.map +1 -0
  218. package/build/typescript/content/DialContent.d.ts +5 -0
  219. package/build/typescript/content/DialContent.d.ts.map +1 -0
  220. package/build/typescript/content/DividerContent.d.ts +5 -0
  221. package/build/typescript/content/DividerContent.d.ts.map +1 -0
  222. package/build/typescript/content/DonutChartContent.d.ts +5 -0
  223. package/build/typescript/content/DonutChartContent.d.ts.map +1 -0
  224. package/build/typescript/content/FormContent.d.ts +19 -0
  225. package/build/typescript/content/FormContent.d.ts.map +1 -0
  226. package/build/typescript/content/FormFieldBridge.d.ts +2 -0
  227. package/build/typescript/content/FormFieldBridge.d.ts.map +1 -0
  228. package/build/typescript/content/GaugeContent.d.ts +5 -0
  229. package/build/typescript/content/GaugeContent.d.ts.map +1 -0
  230. package/build/typescript/content/GridLayoutContent.d.ts +5 -0
  231. package/build/typescript/content/GridLayoutContent.d.ts.map +1 -0
  232. package/build/typescript/content/ImageContent.d.ts +5 -0
  233. package/build/typescript/content/ImageContent.d.ts.map +1 -0
  234. package/build/typescript/content/ListContent.d.ts +5 -0
  235. package/build/typescript/content/ListContent.d.ts.map +1 -0
  236. package/build/typescript/content/LocationContent.d.ts +32 -0
  237. package/build/typescript/content/LocationContent.d.ts.map +1 -0
  238. package/build/typescript/content/MapContent.d.ts +11 -0
  239. package/build/typescript/content/MapContent.d.ts.map +1 -0
  240. package/build/typescript/content/MultipleChoiceContent.d.ts +5 -0
  241. package/build/typescript/content/MultipleChoiceContent.d.ts.map +1 -0
  242. package/build/typescript/content/OpenBadgePreviewContent.d.ts +14 -0
  243. package/build/typescript/content/OpenBadgePreviewContent.d.ts.map +1 -0
  244. package/build/typescript/content/PhotoContent.d.ts +57 -0
  245. package/build/typescript/content/PhotoContent.d.ts.map +1 -0
  246. package/build/typescript/content/PieChartContent.d.ts +5 -0
  247. package/build/typescript/content/PieChartContent.d.ts.map +1 -0
  248. package/build/typescript/content/ProofPresentationContent.d.ts +14 -0
  249. package/build/typescript/content/ProofPresentationContent.d.ts.map +1 -0
  250. package/build/typescript/content/RadioButtonContent.d.ts +5 -0
  251. package/build/typescript/content/RadioButtonContent.d.ts.map +1 -0
  252. package/build/typescript/content/RowContent.d.ts +5 -0
  253. package/build/typescript/content/RowContent.d.ts.map +1 -0
  254. package/build/typescript/content/SectionContent.d.ts +5 -0
  255. package/build/typescript/content/SectionContent.d.ts.map +1 -0
  256. package/build/typescript/content/ShareEntryContent.d.ts +15 -0
  257. package/build/typescript/content/ShareEntryContent.d.ts.map +1 -0
  258. package/build/typescript/content/SimulatedHint.d.ts +9 -0
  259. package/build/typescript/content/SimulatedHint.d.ts.map +1 -0
  260. package/build/typescript/content/SliderContent.d.ts +10 -0
  261. package/build/typescript/content/SliderContent.d.ts.map +1 -0
  262. package/build/typescript/content/SpacerContent.d.ts +5 -0
  263. package/build/typescript/content/SpacerContent.d.ts.map +1 -0
  264. package/build/typescript/content/SpinnerContent.d.ts +5 -0
  265. package/build/typescript/content/SpinnerContent.d.ts.map +1 -0
  266. package/build/typescript/content/SubmitButtonContent.d.ts +9 -0
  267. package/build/typescript/content/SubmitButtonContent.d.ts.map +1 -0
  268. package/build/typescript/content/TextContent.d.ts +5 -0
  269. package/build/typescript/content/TextContent.d.ts.map +1 -0
  270. package/build/typescript/content/TileContent.d.ts +5 -0
  271. package/build/typescript/content/TileContent.d.ts.map +1 -0
  272. package/build/typescript/content/TimelineContent.d.ts +5 -0
  273. package/build/typescript/content/TimelineContent.d.ts.map +1 -0
  274. package/build/typescript/content/TitleContent.d.ts +5 -0
  275. package/build/typescript/content/TitleContent.d.ts.map +1 -0
  276. package/build/typescript/content/VideoContent.d.ts +10 -0
  277. package/build/typescript/content/VideoContent.d.ts.map +1 -0
  278. package/build/typescript/content/WebLinkContent.d.ts +5 -0
  279. package/build/typescript/content/WebLinkContent.d.ts.map +1 -0
  280. package/build/typescript/content/index.d.ts +46 -0
  281. package/build/typescript/content/index.d.ts.map +1 -0
  282. package/build/typescript/form-fields/CheckboxField.d.ts +5 -0
  283. package/build/typescript/form-fields/CheckboxField.d.ts.map +1 -0
  284. package/build/typescript/form-fields/DateField.d.ts +6 -0
  285. package/build/typescript/form-fields/DateField.d.ts.map +1 -0
  286. package/build/typescript/form-fields/DateField.native.d.ts +5 -0
  287. package/build/typescript/form-fields/DateField.native.d.ts.map +1 -0
  288. package/build/typescript/form-fields/DateField.web.d.ts +9 -0
  289. package/build/typescript/form-fields/DateField.web.d.ts.map +1 -0
  290. package/build/typescript/form-fields/DropdownField.d.ts +5 -0
  291. package/build/typescript/form-fields/DropdownField.d.ts.map +1 -0
  292. package/build/typescript/form-fields/MCQField.d.ts +5 -0
  293. package/build/typescript/form-fields/MCQField.d.ts.map +1 -0
  294. package/build/typescript/form-fields/RadioField.d.ts +5 -0
  295. package/build/typescript/form-fields/RadioField.d.ts.map +1 -0
  296. package/build/typescript/form-fields/SliderField.d.ts +6 -0
  297. package/build/typescript/form-fields/SliderField.d.ts.map +1 -0
  298. package/build/typescript/form-fields/SliderField.native.d.ts +5 -0
  299. package/build/typescript/form-fields/SliderField.native.d.ts.map +1 -0
  300. package/build/typescript/form-fields/SliderField.web.d.ts +11 -0
  301. package/build/typescript/form-fields/SliderField.web.d.ts.map +1 -0
  302. package/build/typescript/form-fields/SubmitButtonField.d.ts +5 -0
  303. package/build/typescript/form-fields/SubmitButtonField.d.ts.map +1 -0
  304. package/build/typescript/form-fields/TextField.d.ts +5 -0
  305. package/build/typescript/form-fields/TextField.d.ts.map +1 -0
  306. package/build/typescript/form-fields/index.d.ts +13 -0
  307. package/build/typescript/form-fields/index.d.ts.map +1 -0
  308. package/build/typescript/i18n/WorkflowI18n.d.ts +75 -0
  309. package/build/typescript/i18n/WorkflowI18n.d.ts.map +1 -0
  310. package/build/typescript/icons/VectorIcon.d.ts +4 -0
  311. package/build/typescript/icons/VectorIcon.d.ts.map +1 -0
  312. package/build/typescript/icons/VectorIcon.web.d.ts +16 -0
  313. package/build/typescript/icons/VectorIcon.web.d.ts.map +1 -0
  314. package/build/typescript/icons/WorkflowIcon.d.ts +19 -0
  315. package/build/typescript/icons/WorkflowIcon.d.ts.map +1 -0
  316. package/build/typescript/icons/types.d.ts +12 -0
  317. package/build/typescript/icons/types.d.ts.map +1 -0
  318. package/build/typescript/imageUriCache.d.ts +7 -0
  319. package/build/typescript/imageUriCache.d.ts.map +1 -0
  320. package/build/typescript/index.d.ts +48 -0
  321. package/build/typescript/index.d.ts.map +1 -0
  322. package/build/typescript/modal/WorkflowModal.d.ts +33 -0
  323. package/build/typescript/modal/WorkflowModal.d.ts.map +1 -0
  324. package/build/typescript/package.json +1 -0
  325. package/build/typescript/platform/platformName.d.ts +8 -0
  326. package/build/typescript/platform/platformName.d.ts.map +1 -0
  327. package/build/typescript/platform/platformName.web.d.ts +3 -0
  328. package/build/typescript/platform/platformName.web.d.ts.map +1 -0
  329. package/build/typescript/protocol/controlSnapshotStore.d.ts +12 -0
  330. package/build/typescript/protocol/controlSnapshotStore.d.ts.map +1 -0
  331. package/build/typescript/protocol/useProtocolExchange.d.ts +40 -0
  332. package/build/typescript/protocol/useProtocolExchange.d.ts.map +1 -0
  333. package/build/typescript/registries/ContentRegistry.d.ts +57 -0
  334. package/build/typescript/registries/ContentRegistry.d.ts.map +1 -0
  335. package/build/typescript/registries/FormFieldRegistry.d.ts +37 -0
  336. package/build/typescript/registries/FormFieldRegistry.d.ts.map +1 -0
  337. package/build/typescript/render/NodeBoundary.d.ts +25 -0
  338. package/build/typescript/render/NodeBoundary.d.ts.map +1 -0
  339. package/build/typescript/render/RenderTree.d.ts +23 -0
  340. package/build/typescript/render/RenderTree.d.ts.map +1 -0
  341. package/build/typescript/render/WorkflowRenderContext.d.ts +57 -0
  342. package/build/typescript/render/WorkflowRenderContext.d.ts.map +1 -0
  343. package/build/typescript/render/nodes.d.ts +49 -0
  344. package/build/typescript/render/nodes.d.ts.map +1 -0
  345. package/build/typescript/responsive/ResponsiveProvider.d.ts +39 -0
  346. package/build/typescript/responsive/ResponsiveProvider.d.ts.map +1 -0
  347. package/build/typescript/responsive/index.d.ts +3 -0
  348. package/build/typescript/responsive/index.d.ts.map +1 -0
  349. package/build/typescript/responsive/responsive.d.ts +24 -0
  350. package/build/typescript/responsive/responsive.d.ts.map +1 -0
  351. package/build/typescript/style/resolveDisplayHintStyle.d.ts +23 -0
  352. package/build/typescript/style/resolveDisplayHintStyle.d.ts.map +1 -0
  353. package/build/typescript/theme/WorkflowTheme.d.ts +177 -0
  354. package/build/typescript/theme/WorkflowTheme.d.ts.map +1 -0
  355. package/build/typescript/utils/testable.d.ts +8 -0
  356. package/build/typescript/utils/testable.d.ts.map +1 -0
  357. package/package.json +104 -3
  358. package/src/WorkflowFontScaleContext.tsx +74 -0
  359. package/src/adapter/WalletAdapter.tsx +225 -0
  360. package/src/components/FallbackVideoPlayer.native.tsx +9 -0
  361. package/src/components/FallbackVideoPlayer.tsx +5 -0
  362. package/src/components/FallbackVideoPlayer.web.tsx +24 -0
  363. package/src/components/WorkflowButtonLabel.tsx +41 -0
  364. package/src/components/WorkflowCalendarIcon.tsx +52 -0
  365. package/src/components/WorkflowText.tsx +121 -0
  366. package/src/content/BadgeContent.tsx +57 -0
  367. package/src/content/BarChartContent.tsx +76 -0
  368. package/src/content/BarcodeContent.tsx +59 -0
  369. package/src/content/BasicTableContent.tsx +139 -0
  370. package/src/content/ButtonContent.tsx +124 -0
  371. package/src/content/CalendarContent.tsx +178 -0
  372. package/src/content/CardContent.tsx +137 -0
  373. package/src/content/CarouselContent.tsx +197 -0
  374. package/src/content/ChipContent.tsx +209 -0
  375. package/src/content/ChipRowContent.tsx +133 -0
  376. package/src/content/CredentialOfferContent.tsx +229 -0
  377. package/src/content/DialContent.tsx +96 -0
  378. package/src/content/DividerContent.tsx +33 -0
  379. package/src/content/DonutChartContent.tsx +110 -0
  380. package/src/content/FormContent.tsx +158 -0
  381. package/src/content/FormFieldBridge.tsx +144 -0
  382. package/src/content/GaugeContent.tsx +66 -0
  383. package/src/content/GridLayoutContent.tsx +285 -0
  384. package/src/content/ImageContent.tsx +222 -0
  385. package/src/content/ListContent.tsx +98 -0
  386. package/src/content/LocationContent.tsx +135 -0
  387. package/src/content/MapContent.tsx +232 -0
  388. package/src/content/MultipleChoiceContent.tsx +74 -0
  389. package/src/content/OpenBadgePreviewContent.tsx +93 -0
  390. package/src/content/PhotoContent.tsx +110 -0
  391. package/src/content/PieChartContent.tsx +121 -0
  392. package/src/content/ProofPresentationContent.tsx +127 -0
  393. package/src/content/RadioButtonContent.tsx +129 -0
  394. package/src/content/RowContent.tsx +627 -0
  395. package/src/content/SectionContent.tsx +133 -0
  396. package/src/content/ShareEntryContent.tsx +109 -0
  397. package/src/content/SimulatedHint.tsx +20 -0
  398. package/src/content/SliderContent.tsx +56 -0
  399. package/src/content/SpacerContent.tsx +15 -0
  400. package/src/content/SpinnerContent.tsx +24 -0
  401. package/src/content/SubmitButtonContent.tsx +256 -0
  402. package/src/content/TextContent.tsx +140 -0
  403. package/src/content/TileContent.tsx +216 -0
  404. package/src/content/TimelineContent.tsx +91 -0
  405. package/src/content/TitleContent.tsx +49 -0
  406. package/src/content/VideoContent.tsx +131 -0
  407. package/src/content/WebLinkContent.tsx +87 -0
  408. package/src/content/index.ts +45 -0
  409. package/src/form-fields/CheckboxField.tsx +29 -0
  410. package/src/form-fields/DateField.native.tsx +123 -0
  411. package/src/form-fields/DateField.tsx +5 -0
  412. package/src/form-fields/DateField.web.tsx +32 -0
  413. package/src/form-fields/DropdownField.tsx +137 -0
  414. package/src/form-fields/MCQField.tsx +68 -0
  415. package/src/form-fields/RadioField.tsx +53 -0
  416. package/src/form-fields/SliderField.native.tsx +53 -0
  417. package/src/form-fields/SliderField.tsx +5 -0
  418. package/src/form-fields/SliderField.web.tsx +58 -0
  419. package/src/form-fields/SubmitButtonField.tsx +33 -0
  420. package/src/form-fields/TextField.tsx +49 -0
  421. package/src/form-fields/index.ts +12 -0
  422. package/src/i18n/WorkflowI18n.tsx +100 -0
  423. package/src/icons/VectorIcon.tsx +10 -0
  424. package/src/icons/VectorIcon.web.tsx +55 -0
  425. package/src/icons/WorkflowIcon.tsx +30 -0
  426. package/src/icons/types.ts +13 -0
  427. package/src/imageUriCache.ts +27 -0
  428. package/src/index.ts +97 -0
  429. package/src/modal/WorkflowModal.tsx +119 -0
  430. package/src/platform/platformName.ts +7 -0
  431. package/src/platform/platformName.web.ts +2 -0
  432. package/src/protocol/controlSnapshotStore.ts +25 -0
  433. package/src/protocol/useProtocolExchange.ts +185 -0
  434. package/src/registries/ContentRegistry.tsx +130 -0
  435. package/src/registries/FormFieldRegistry.tsx +83 -0
  436. package/src/render/NodeBoundary.tsx +69 -0
  437. package/src/render/RenderTree.tsx +63 -0
  438. package/src/render/WorkflowRenderContext.tsx +71 -0
  439. package/src/render/nodes.ts +104 -0
  440. package/src/responsive/ResponsiveProvider.tsx +103 -0
  441. package/src/responsive/index.ts +7 -0
  442. package/src/responsive/responsive.ts +67 -0
  443. package/src/style/resolveDisplayHintStyle.ts +153 -0
  444. package/src/theme/WorkflowTheme.tsx +162 -0
  445. package/src/utils/testable.ts +10 -0
@@ -0,0 +1,281 @@
1
+ "use strict";
2
+
3
+ import { buildInputFromValues, flattenInputSchema, isInputComplete } from '@veridid/workflow-core';
4
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
5
+ import { ActivityIndicator, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native';
6
+ import WorkflowButtonLabel from "../components/WorkflowButtonLabel.js";
7
+ import { useWorkflowT } from "../i18n/WorkflowI18n.js";
8
+ import { ContentRegistry } from "../registries/ContentRegistry.js";
9
+ import { useResponsive } from "../responsive/index.js";
10
+ import { resolveButtonFillStyle, resolveSurfaceBackground } from "../style/resolveDisplayHintStyle.js";
11
+ import { testIdWithKey } from "../utils/testable.js";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ const ERROR_FLASH_MS = 2200;
14
+ const ERROR_COLOR = '#FFB020';
15
+ const SubmitButtonContent = ({
16
+ item,
17
+ onAction,
18
+ formData = {},
19
+ fillContainer,
20
+ groupFontScale = 1,
21
+ disabled
22
+ }) => {
23
+ const {
24
+ s,
25
+ ms,
26
+ isSmall
27
+ } = useResponsive();
28
+ // Tracks whether THIS button was the one tapped — `disabled` alone (the
29
+ // screen-wide busy flag) can't distinguish that, it's the same `true` for
30
+ // every button on screen the instant any one of them fires. Only the
31
+ // tapped one swaps its label for a spinner; the rest just go inert.
32
+ const t = useWorkflowT();
33
+ const [isSubmitting, setIsSubmitting] = useState(false);
34
+ // Brief, self-clearing error indicator on THIS button when its own tap's
35
+ // advance() rejects — the exit path back to normal is automatic (a timer),
36
+ // never a dead end waiting on some other signal. Independent of `disabled`
37
+ // clearing (which can happen in the same tick via the host's own
38
+ // try/finally) so the flash is visible on its own terms.
39
+ const [hasError, setHasError] = useState(false);
40
+ const mountedRef = useRef(true);
41
+ const errorTimerRef = useRef(null);
42
+ useEffect(() => {
43
+ return () => {
44
+ mountedRef.current = false;
45
+ if (errorTimerRef.current) clearTimeout(errorTimerRef.current);
46
+ };
47
+ }, []);
48
+
49
+ // The screen clears `disabled` once advance() settles (success or error) —
50
+ // reset local state in lockstep so a later tap isn't stuck showing a
51
+ // spinner from a previous, already-finished submit. advance() itself is
52
+ // bounded by the workflow engine's own action timeout, so this is never an
53
+ // indefinite wait.
54
+ useEffect(() => {
55
+ if (!disabled) setIsSubmitting(false);
56
+ }, [disabled]);
57
+ const handlePress = () => {
58
+ if (disabled) return;
59
+ const id = item.event || item.actionID;
60
+ if (!id) return;
61
+ const input = item.input;
62
+ const payload = input ? {
63
+ ...formData,
64
+ ...input
65
+ } : formData;
66
+ if (errorTimerRef.current) {
67
+ clearTimeout(errorTimerRef.current);
68
+ errorTimerRef.current = null;
69
+ }
70
+ setHasError(false);
71
+ setIsSubmitting(true);
72
+ const result = onAction(id, payload);
73
+ if (result && typeof result.catch === 'function') {
74
+ ;
75
+ result.catch(() => {
76
+ if (!mountedRef.current) return;
77
+ setHasError(true);
78
+ errorTimerRef.current = setTimeout(() => {
79
+ if (mountedRef.current) setHasError(false);
80
+ }, ERROR_FLASH_MS);
81
+ });
82
+ }
83
+ };
84
+ const compact = item.compact === true;
85
+ const label = String(item.label || t('WorkflowUi.Submit'));
86
+ const icon = item.icon != null ? String(item.icon) : '';
87
+ const displayLabel = icon ? `${icon} ${label}` : label;
88
+ const hasCustomFill = resolveSurfaceBackground(item.bgColor) !== 'transparent';
89
+ const outlineStyle = !hasCustomFill ? {
90
+ backgroundColor: 'transparent',
91
+ borderWidth: 1.5,
92
+ borderColor: '#FFFFFF'
93
+ } : null;
94
+ const fillStyle = resolveButtonFillStyle(item, {
95
+ includePadding: false
96
+ });
97
+ const labelColor = '#FFFFFF';
98
+ if (compact) {
99
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
100
+ style: [{
101
+ paddingHorizontal: s(12),
102
+ paddingVertical: s(8),
103
+ borderRadius: 999,
104
+ alignSelf: 'flex-end',
105
+ flexShrink: 1,
106
+ minWidth: 0
107
+ }, fillStyle, outlineStyle, disabled ? sBase.disabled : null],
108
+ onPress: handlePress,
109
+ disabled: disabled,
110
+ activeOpacity: 0.8,
111
+ children: isSubmitting ? /*#__PURE__*/_jsx(ActivityIndicator, {
112
+ size: "small",
113
+ color: labelColor
114
+ }) : /*#__PURE__*/_jsx(WorkflowButtonLabel, {
115
+ style: {
116
+ color: hasError ? ERROR_COLOR : labelColor,
117
+ fontWeight: '700',
118
+ fontSize: ms(13)
119
+ },
120
+ groupFontScale: groupFontScale,
121
+ children: hasError ? `⚠ ${displayLabel}` : displayLabel
122
+ })
123
+ });
124
+ }
125
+ const minHeight = s(isSmall ? 44 : 52);
126
+ return /*#__PURE__*/_jsx(TouchableOpacity, {
127
+ style: [sBase.pill, {
128
+ minHeight,
129
+ borderRadius: minHeight / 2,
130
+ paddingVertical: s(isSmall ? 10 : 14),
131
+ paddingHorizontal: s(isSmall ? 12 : 16),
132
+ marginTop: fillContainer ? 0 : s(8)
133
+ }, fillContainer ? {
134
+ flex: 1,
135
+ alignSelf: 'stretch',
136
+ height: '100%',
137
+ maxWidth: '100%'
138
+ } : null, fillStyle, outlineStyle, disabled ? sBase.disabled : null],
139
+ onPress: handlePress,
140
+ disabled: disabled,
141
+ activeOpacity: 0.85,
142
+ children: isSubmitting ? /*#__PURE__*/_jsx(ActivityIndicator, {
143
+ size: "small",
144
+ color: labelColor
145
+ }) : /*#__PURE__*/_jsx(WorkflowButtonLabel, {
146
+ style: [sBase.pillText, {
147
+ color: hasError ? ERROR_COLOR : labelColor,
148
+ fontSize: ms(isSmall ? 13 : 15)
149
+ }],
150
+ groupFontScale: groupFontScale,
151
+ children: hasError ? `⚠ ${displayLabel}` : displayLabel
152
+ })
153
+ });
154
+ };
155
+ const sBase = StyleSheet.create({
156
+ pill: {
157
+ flexDirection: 'row',
158
+ width: '100%',
159
+ alignItems: 'center',
160
+ justifyContent: 'center',
161
+ flexShrink: 1,
162
+ minWidth: 0
163
+ },
164
+ pillText: {
165
+ fontWeight: '700',
166
+ textAlign: 'center',
167
+ width: '100%'
168
+ },
169
+ disabled: {
170
+ opacity: 0.5
171
+ }
172
+ });
173
+
174
+ /**
175
+ * Submit button with an `input_schema`: renders one text field per schema
176
+ * leaf above the button, keeps the button disabled until required fields are
177
+ * filled, and sends the nested `input` built from the schema (not the screen's
178
+ * other form values or a static `input`). Same behaviour as the wallet's
179
+ * former inline renderer in WorkflowDetails.
180
+ */
181
+ const SchemaSubmitButtonContent = props => {
182
+ const {
183
+ item,
184
+ colors,
185
+ onAction,
186
+ disabled
187
+ } = props;
188
+ const fields = useMemo(() => flattenInputSchema(item.input_schema), [item.input_schema]);
189
+ const [values, setValues] = useState({});
190
+ const complete = isInputComplete(fields, values);
191
+ return /*#__PURE__*/_jsxs(View, {
192
+ style: schemaStyles.container,
193
+ children: [/*#__PURE__*/_jsx(View, {
194
+ style: [schemaStyles.fields, {
195
+ borderColor: colors.border
196
+ }],
197
+ children: fields.map(field => {
198
+ const key = field.path.join('.');
199
+ return /*#__PURE__*/_jsxs(View, {
200
+ style: schemaStyles.field,
201
+ children: [/*#__PURE__*/_jsxs(Text, {
202
+ style: [schemaStyles.label, {
203
+ color: colors.text
204
+ }],
205
+ children: [field.title, field.required ? /*#__PURE__*/_jsx(Text, {
206
+ style: schemaStyles.required,
207
+ children: " *"
208
+ }) : null]
209
+ }), field.description ? /*#__PURE__*/_jsx(Text, {
210
+ style: schemaStyles.description,
211
+ children: field.description
212
+ }) : null, /*#__PURE__*/_jsx(TextInput, {
213
+ style: [schemaStyles.input, {
214
+ borderColor: colors.border,
215
+ color: colors.text
216
+ }],
217
+ value: values[key] ?? '',
218
+ onChangeText: value => setValues(prev => ({
219
+ ...prev,
220
+ [key]: value
221
+ })),
222
+ placeholder: `Enter ${field.title.toLowerCase()}...`,
223
+ placeholderTextColor: "#9CA3AF",
224
+ autoCapitalize: "none",
225
+ autoCorrect: false,
226
+ testID: testIdWithKey(`FormField-${key}`)
227
+ })]
228
+ }, key);
229
+ })
230
+ }), /*#__PURE__*/_jsx(SubmitButtonContent, {
231
+ ...props,
232
+ disabled: disabled || !complete,
233
+ onAction: id => onAction(id, buildInputFromValues(fields, values))
234
+ })]
235
+ });
236
+ };
237
+ const schemaStyles = StyleSheet.create({
238
+ container: {
239
+ marginBottom: 12
240
+ },
241
+ fields: {
242
+ borderRadius: 12,
243
+ borderWidth: 1,
244
+ padding: 16,
245
+ marginBottom: 12
246
+ },
247
+ field: {
248
+ marginBottom: 16
249
+ },
250
+ label: {
251
+ fontSize: 14,
252
+ fontWeight: '600',
253
+ marginBottom: 4
254
+ },
255
+ required: {
256
+ color: '#DC2626'
257
+ },
258
+ description: {
259
+ fontSize: 12,
260
+ color: '#9CA3AF',
261
+ marginBottom: 4
262
+ },
263
+ input: {
264
+ backgroundColor: 'transparent',
265
+ borderRadius: 8,
266
+ borderWidth: 1,
267
+ paddingHorizontal: 12,
268
+ paddingVertical: 10,
269
+ fontSize: 14
270
+ }
271
+ });
272
+
273
+ /** Uses the schema form when the item declares an `input_schema` with fields. */
274
+ const SubmitButtonEntry = props => flattenInputSchema(props.item.input_schema).length > 0 ? /*#__PURE__*/_jsx(SchemaSubmitButtonContent, {
275
+ ...props
276
+ }) : /*#__PURE__*/_jsx(SubmitButtonContent, {
277
+ ...props
278
+ });
279
+ ContentRegistry.register('submit-button', SubmitButtonEntry);
280
+ export default SubmitButtonEntry;
281
+ //# sourceMappingURL=SubmitButtonContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["buildInputFromValues","flattenInputSchema","isInputComplete","React","useEffect","useMemo","useRef","useState","ActivityIndicator","StyleSheet","Text","TextInput","TouchableOpacity","View","WorkflowButtonLabel","useWorkflowT","ContentRegistry","useResponsive","resolveButtonFillStyle","resolveSurfaceBackground","testIdWithKey","jsx","_jsx","jsxs","_jsxs","ERROR_FLASH_MS","ERROR_COLOR","SubmitButtonContent","item","onAction","formData","fillContainer","groupFontScale","disabled","s","ms","isSmall","t","isSubmitting","setIsSubmitting","hasError","setHasError","mountedRef","errorTimerRef","current","clearTimeout","handlePress","id","event","actionID","input","payload","result","catch","setTimeout","compact","label","String","icon","displayLabel","hasCustomFill","bgColor","outlineStyle","backgroundColor","borderWidth","borderColor","fillStyle","includePadding","labelColor","style","paddingHorizontal","paddingVertical","borderRadius","alignSelf","flexShrink","minWidth","sBase","onPress","activeOpacity","children","size","color","fontWeight","fontSize","minHeight","pill","marginTop","flex","height","maxWidth","pillText","create","flexDirection","width","alignItems","justifyContent","textAlign","opacity","SchemaSubmitButtonContent","props","colors","fields","input_schema","values","setValues","complete","schemaStyles","container","border","map","field","key","path","join","text","title","required","description","value","onChangeText","prev","placeholder","toLowerCase","placeholderTextColor","autoCapitalize","autoCorrect","testID","marginBottom","padding","SubmitButtonEntry","length","register"],"sourceRoot":"../../../src","sources":["content/SubmitButtonContent.tsx"],"mappings":";;AAAA,SAASA,oBAAoB,EAAEC,kBAAkB,EAAoBC,eAAe,QAAQ,wBAAwB;AACpH,OAAOC,KAAK,IAAIC,SAAS,EAAE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EAAE;EACZ;AACF,CAAC,CAAC;;AAEF;AACA,MAAM8C,iBAAqD,GAAI9B,KAAK,IAClElG,kBAAkB,CAACkG,KAAK,CAACvE,IAAI,CAAC0E,YAAuC,CAAC,CAAC4B,MAAM,GAAG,CAAC,gBAC/E5G,IAAA,CAAC4E,yBAAyB;EAAA,GAAKC;AAAK,CAAG,CAAC,gBAExC7E,IAAA,CAACK,mBAAmB;EAAA,GAAKwE;AAAK,CAAG,CAClC;AAEHnF,eAAe,CAACmH,QAAQ,CAAC,eAAe,EAAEF,iBAAiB,CAAC;AAE5D,eAAeA,iBAAiB","ignoreList":[]}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View } from 'react-native';
5
+ import WorkflowText from "../components/WorkflowText.js";
6
+ import { WorkflowIcon } from "../icons/WorkflowIcon.js";
7
+ import { ContentRegistry } from "../registries/ContentRegistry.js";
8
+ import { useResponsive } from "../responsive/index.js";
9
+ import { resolveItemSurfaceStyle } from "../style/resolveDisplayHintStyle.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const TextContent = ({
12
+ item,
13
+ styles,
14
+ colors
15
+ }) => {
16
+ const {
17
+ s
18
+ } = useResponsive();
19
+ const text = item.text || '';
20
+ const type = item.type || 'text';
21
+ const getIconConfig = () => {
22
+ switch (type) {
23
+ case 'information':
24
+ return {
25
+ name: 'info',
26
+ color: '#2196F3'
27
+ };
28
+ case 'warning':
29
+ return {
30
+ name: 'warning',
31
+ color: '#FF9800'
32
+ };
33
+ case 'error':
34
+ return {
35
+ name: 'error',
36
+ color: '#F44336'
37
+ };
38
+ case 'pass':
39
+ return {
40
+ name: 'check-circle',
41
+ color: '#4CAF50'
42
+ };
43
+ case 'fail':
44
+ return {
45
+ name: 'cancel',
46
+ color: '#F44336'
47
+ };
48
+ default:
49
+ return null;
50
+ }
51
+ };
52
+ const iconConfig = getIconConfig();
53
+ if (type === 'text') {
54
+ const textColor = typeof item.color === 'string' && item.color.trim() || colors.text;
55
+ const sizeRaw = item.size ?? item.fontSize;
56
+ const size = typeof sizeRaw === 'number' && Number.isFinite(sizeRaw) ? sizeRaw : typeof sizeRaw === 'string' && /^\d+(\.\d+)?$/.test(sizeRaw) ? Number(sizeRaw) : undefined;
57
+ const weightRaw = item.fontWeight;
58
+ const fontWeight = weightRaw === '700' || weightRaw === 'bold' || weightRaw === 700 ? '700' : weightRaw === '600' || weightRaw === 600 ? '600' : weightRaw === '500' || weightRaw === 500 ? '500' : undefined;
59
+ const lines = typeof item.numberOfLines === 'number' && Number.isFinite(item.numberOfLines) ? item.numberOfLines : undefined;
60
+ const lineHeightRaw = item.lineHeight;
61
+ const lineHeight = typeof lineHeightRaw === 'number' && Number.isFinite(lineHeightRaw) ? lineHeightRaw : typeof lineHeightRaw === 'string' && /^\d+(\.\d+)?$/.test(lineHeightRaw) ? Number(lineHeightRaw) : undefined;
62
+ const textAlignRaw = String(item.textAlign || item.align || '').toLowerCase();
63
+ const textAlign = textAlignRaw === 'center' || textAlignRaw === 'middle' ? 'center' : textAlignRaw === 'end' || textAlignRaw === 'right' || textAlignRaw === 'flex-end' ? 'right' : textAlignRaw === 'start' || textAlignRaw === 'left' || textAlignRaw === 'flex-start' ? 'left' : undefined;
64
+ return /*#__PURE__*/_jsx(View, {
65
+ style: [styles.fieldContainer, resolveItemSurfaceStyle(item), {
66
+ marginBottom: 0,
67
+ ...(textAlign === 'right' ? {
68
+ alignItems: 'flex-end',
69
+ width: '100%'
70
+ } : null)
71
+ }],
72
+ children: /*#__PURE__*/_jsx(WorkflowText, {
73
+ variant: fontWeight === '700' || fontWeight === '600' ? 'label' : 'body',
74
+ size: size,
75
+ numberOfLines: lines,
76
+ style: {
77
+ color: textColor,
78
+ fontWeight,
79
+ width: textAlign === 'right' ? undefined : '100%',
80
+ ...(lineHeight != null ? {
81
+ lineHeight
82
+ } : null),
83
+ ...(textAlign != null ? {
84
+ textAlign
85
+ } : null)
86
+ },
87
+ children: text
88
+ })
89
+ });
90
+ }
91
+ return /*#__PURE__*/_jsxs(View, {
92
+ style: [styles.fieldContainer, resolveItemSurfaceStyle(item), {
93
+ flexDirection: 'row',
94
+ alignItems: 'flex-start',
95
+ borderRadius: s(8),
96
+ borderWidth: 1,
97
+ borderColor: iconConfig?.color || colors.border,
98
+ minWidth: 0
99
+ }, !item.bgColor ? {
100
+ backgroundColor: `${iconConfig?.color}15`
101
+ } : null],
102
+ children: [iconConfig ? /*#__PURE__*/_jsx(WorkflowIcon, {
103
+ name: iconConfig.name,
104
+ size: s(24),
105
+ color: iconConfig.color,
106
+ style: {
107
+ marginRight: s(12),
108
+ marginTop: 2
109
+ }
110
+ }) : null, /*#__PURE__*/_jsx(WorkflowText, {
111
+ variant: "body",
112
+ style: {
113
+ color: colors.text,
114
+ flex: 1
115
+ },
116
+ children: text
117
+ })]
118
+ });
119
+ };
120
+ ContentRegistry.register('text', TextContent);
121
+ ContentRegistry.register('information', TextContent);
122
+ ContentRegistry.register('warning', TextContent);
123
+ ContentRegistry.register('error', TextContent);
124
+ ContentRegistry.register('pass', TextContent);
125
+ ContentRegistry.register('fail', TextContent);
126
+ export default TextContent;
127
+ //# sourceMappingURL=TextContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","WorkflowText","WorkflowIcon","ContentRegistry","useResponsive","resolveItemSurfaceStyle","jsx","_jsx","jsxs","_jsxs","TextContent","item","styles","colors","s","text","type","getIconConfig","name","color","iconConfig","textColor","trim","sizeRaw","size","fontSize","Number","isFinite","test","undefined","weightRaw","fontWeight","lines","numberOfLines","lineHeightRaw","lineHeight","textAlignRaw","String","textAlign","align","toLowerCase","style","fieldContainer","marginBottom","alignItems","width","children","variant","flexDirection","borderRadius","borderWidth","borderColor","border","minWidth","bgColor","backgroundColor","marginRight","marginTop","flex","register"],"sourceRoot":"../../../src","sources":["content/TextContent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,c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EAAE,CAAC;MACdC,WAAW,EAAE/B,UAAU,EAAED,KAAK,IAAIN,MAAM,CAACuC,MAAM;MAC/CC,QAAQ,EAAE;IACZ,CAAC,EACD,CAAC1C,IAAI,CAAC2C,OAAO,GACT;MACEC,eAAe,EAAE,GAAGnC,UAAU,EAAED,KAAK;IACvC,CAAC,GACD,IAAI,CACR;IAAA2B,QAAA,GAED1B,UAAU,gBACTb,IAAA,CAACL,YAAY;MACXgB,IAAI,EAAEE,UAAU,CAACF,IAAK;MACtBM,IAAI,EAAEV,CAAC,CAAC,EAAE,CAAE;MACZK,KAAK,EAAEC,UAAU,CAACD,KAAM;MACxBsB,KAAK,EAAE;QAAEe,WAAW,EAAE1C,CAAC,CAAC,EAAE,CAAC;QAAE2C,SAAS,EAAE;MAAE;IAAE,CAC7C,CAAC,GACA,IAAI,eACRlD,IAAA,CAACN,YAAY;MAAC8C,OAAO,EAAC,MAAM;MAACN,KAAK,EAAE;QAAEtB,KAAK,EAAEN,MAAM,CAACE,IAAI;QAAE2C,IAAI,EAAE;MAAE,CAAE;MAAAZ,QAAA,EACjE/B;IAAI,CACO,CAAC;EAAA,CACX,CAAC;AAEX,CAAC;AAEDZ,eAAe,CAACwD,QAAQ,CAAC,MAAM,EAAEjD,WAAW,CAAC;AAC7CP,eAAe,CAACwD,QAAQ,CAAC,aAAa,EAAEjD,WAAW,CAAC;AACpDP,eAAe,CAACwD,QAAQ,CAAC,SAAS,EAAEjD,WAAW,CAAC;AAChDP,eAAe,CAACwD,QAAQ,CAAC,OAAO,EAAEjD,WAAW,CAAC;AAC9CP,eAAe,CAACwD,QAAQ,CAAC,MAAM,EAAEjD,WAAW,CAAC;AAC7CP,eAAe,CAACwD,QAAQ,CAAC,MAAM,EAAEjD,WAAW,CAAC;AAE7C,eAAeA,WAAW","ignoreList":[]}
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { Image, TouchableOpacity, View } from 'react-native';
5
+ import WorkflowText from "../components/WorkflowText.js";
6
+ import { ContentRegistry } from "../registries/ContentRegistry.js";
7
+ import { deriveNode } from "../render/nodes.js";
8
+ import { useResponsive } from "../responsive/index.js";
9
+ import { resolveAspectRatio, resolveItemBackgroundColor } from "../style/resolveDisplayHintStyle.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const TOUCHABLE_CHILD_TYPES = new Set(['button', 'submit-button', 'chip', 'tile']);
12
+ const TileContent = ({
13
+ item,
14
+ colors,
15
+ onAction,
16
+ styles,
17
+ formData,
18
+ onFieldChange,
19
+ mediaFrame,
20
+ disabled
21
+ }) => {
22
+ const {
23
+ s,
24
+ isSmall
25
+ } = useResponsive();
26
+ const layout = item.layout ?? 'horizontal';
27
+ const title = item.title ?? '';
28
+ const subtitle = item.subtitle ?? '';
29
+ const text = item.text ?? '';
30
+ const bodyText = text && text.trim() === subtitle.trim() ? '' : text;
31
+ const imageUrl = item.image ?? item.url;
32
+ const badges = item.badges ?? [];
33
+ const event = item.event;
34
+ const input = item.input;
35
+ const children = item.children;
36
+ const isVertical = layout === 'vertical';
37
+ const isSquare = resolveAspectRatio(item.aspectRatio ?? item.ratio) === 1;
38
+ const tileSize = mediaFrame?.width ?? s(isSmall ? 160 : 180);
39
+ const tileWidth = isSquare ? tileSize : mediaFrame?.width ?? '100%';
40
+ const imageSize = s(isSmall ? 72 : 88);
41
+ const imageStyle = isVertical ? isSquare ? {
42
+ width: '100%',
43
+ flex: 1,
44
+ minHeight: 0,
45
+ borderRadius: s(8)
46
+ } : {
47
+ width: '100%',
48
+ height: mediaFrame?.height ?? s(isSmall ? 140 : 160),
49
+ borderRadius: s(8)
50
+ } : {
51
+ width: imageSize,
52
+ height: imageSize,
53
+ borderRadius: s(8)
54
+ };
55
+ const actionChildren = [];
56
+ const contentChildren = [];
57
+ for (const c of children ?? []) {
58
+ if (c && TOUCHABLE_CHILD_TYPES.has(String(c.type))) actionChildren.push(c);else contentChildren.push(c);
59
+ }
60
+ const TitleBlock = title ? /*#__PURE__*/_jsx(WorkflowText, {
61
+ variant: "title",
62
+ numberOfLines: 1,
63
+ style: {
64
+ color: colors.text,
65
+ width: '100%'
66
+ },
67
+ children: title
68
+ }) : null;
69
+ const MetaBlock = /*#__PURE__*/_jsxs(View, {
70
+ style: {
71
+ minWidth: 0,
72
+ justifyContent: 'center',
73
+ gap: s(4),
74
+ ...(isVertical ? null : {
75
+ flex: 1
76
+ })
77
+ },
78
+ children: [!isVertical ? TitleBlock : null, subtitle ? /*#__PURE__*/_jsx(WorkflowText, {
79
+ variant: "subtitle",
80
+ numberOfLines: 2,
81
+ style: {
82
+ color: colors.text,
83
+ opacity: 0.7,
84
+ width: '100%'
85
+ },
86
+ children: subtitle
87
+ }) : null, bodyText ? /*#__PURE__*/_jsx(WorkflowText, {
88
+ variant: "caption",
89
+ numberOfLines: 2,
90
+ style: {
91
+ color: colors.text,
92
+ opacity: 0.7,
93
+ width: '100%'
94
+ },
95
+ children: bodyText
96
+ }) : null, badges.length > 0 ? /*#__PURE__*/_jsx(View, {
97
+ style: {
98
+ flexDirection: 'row',
99
+ flexWrap: 'wrap',
100
+ gap: s(6),
101
+ marginTop: s(4)
102
+ },
103
+ children: badges.map((b, i) => /*#__PURE__*/_jsx(View, {
104
+ style: {
105
+ maxWidth: '100%'
106
+ },
107
+ children: ContentRegistry.render('badge', {
108
+ item: {
109
+ type: 'badge',
110
+ label: b.label,
111
+ tone: b.tone
112
+ },
113
+ onAction,
114
+ styles,
115
+ colors,
116
+ formData,
117
+ onFieldChange
118
+ })
119
+ }, `tile-badge-${i}`))
120
+ }) : null, contentChildren.map((child, i) => ContentRegistry.has(child.type) ? /*#__PURE__*/_jsx(View, {
121
+ style: {
122
+ minWidth: 0
123
+ },
124
+ children: ContentRegistry.render(child.type, {
125
+ item: child,
126
+ onAction,
127
+ styles,
128
+ colors,
129
+ formData,
130
+ onFieldChange,
131
+ disabled
132
+ })
133
+ }, `tile-cc-${i}`) : null)]
134
+ });
135
+ const PrimaryRegion = /*#__PURE__*/_jsxs(View, {
136
+ style: {
137
+ flexDirection: isVertical ? 'column' : 'row',
138
+ gap: isVertical && isSquare ? s(6) : s(12),
139
+ flex: 1,
140
+ minWidth: 0,
141
+ minHeight: 0,
142
+ alignItems: isVertical ? 'stretch' : 'center'
143
+ },
144
+ children: [isVertical && title ? /*#__PURE__*/_jsx(View, {
145
+ style: {
146
+ flexShrink: 0,
147
+ width: '100%'
148
+ },
149
+ children: TitleBlock
150
+ }) : null, imageUrl ? /*#__PURE__*/_jsx(View, {
151
+ style: isVertical && isSquare ? {
152
+ flex: 1,
153
+ minHeight: 0,
154
+ width: '100%',
155
+ overflow: 'hidden',
156
+ borderRadius: s(8)
157
+ } : undefined,
158
+ children: /*#__PURE__*/_jsx(Image, {
159
+ source: {
160
+ uri: imageUrl
161
+ },
162
+ style: isVertical && isSquare ? {
163
+ width: '100%',
164
+ height: '100%'
165
+ } : imageStyle,
166
+ resizeMode: "cover"
167
+ })
168
+ }) : null, isVertical ? /*#__PURE__*/_jsx(View, {
169
+ style: {
170
+ flexShrink: 0,
171
+ width: '100%',
172
+ minWidth: 0
173
+ },
174
+ children: MetaBlock
175
+ }) : MetaBlock]
176
+ });
177
+ const ActionColumn = actionChildren.length > 0 && /*#__PURE__*/_jsx(View, {
178
+ style: {
179
+ flexDirection: isVertical ? 'row' : 'column',
180
+ gap: s(6),
181
+ alignItems: isVertical ? 'stretch' : 'flex-end',
182
+ justifyContent: 'center',
183
+ flexShrink: 0
184
+ },
185
+ children: actionChildren.map((child, i) => ContentRegistry.has(child.type) ? /*#__PURE__*/_jsx(View, {
186
+ children: ContentRegistry.render(child.type, {
187
+ item: deriveNode(child, {
188
+ compact: true
189
+ }),
190
+ onAction,
191
+ styles,
192
+ colors,
193
+ formData,
194
+ onFieldChange,
195
+ disabled
196
+ })
197
+ }, `tile-ac-${i}`) : null)
198
+ });
199
+ return /*#__PURE__*/_jsxs(View, {
200
+ style: {
201
+ flexDirection: isVertical ? 'column' : 'row',
202
+ alignItems: isVertical ? 'stretch' : 'center',
203
+ padding: s(12),
204
+ borderRadius: s(12),
205
+ borderWidth: 1,
206
+ borderColor: colors.border,
207
+ backgroundColor: resolveItemBackgroundColor(item) ?? colors.background,
208
+ width: tileWidth,
209
+ maxWidth: isSquare ? tileSize : '100%',
210
+ height: isSquare ? tileSize : undefined,
211
+ alignSelf: isSquare ? 'flex-start' : 'stretch',
212
+ gap: isSquare && isVertical ? s(6) : s(12),
213
+ minWidth: 0,
214
+ overflow: 'hidden',
215
+ ...(mediaFrame && !isSquare ? {
216
+ height: '100%',
217
+ flex: 1
218
+ } : null)
219
+ },
220
+ children: [event ? /*#__PURE__*/_jsx(TouchableOpacity, {
221
+ activeOpacity: 0.85,
222
+ disabled: disabled,
223
+ onPress: () => onAction(event, input ?? {}),
224
+ style: [{
225
+ flex: 1,
226
+ minWidth: 0,
227
+ minHeight: 0
228
+ }, disabled ? {
229
+ opacity: 0.5
230
+ } : null],
231
+ children: PrimaryRegion
232
+ }) : PrimaryRegion, ActionColumn]
233
+ });
234
+ };
235
+ ContentRegistry.register('tile', TileContent);
236
+ export default TileContent;
237
+ //# sourceMappingURL=TileContent.js.map