@saasquatch/mint-components 1.12.0-2 → 1.12.0-20

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 (463) hide show
  1. package/dist/cjs/{ShadowViewAddon-13173901.js → ShadowViewAddon-040cffad.js} +38 -36
  2. package/dist/cjs/extractProps-fd93ba62.js +21 -0
  3. package/dist/cjs/{global-e4ebdbcc.js → global-c3637175.js} +10 -161
  4. package/dist/cjs/{index.module-236d0403.js → index.module-b8d9d0ba.js} +228 -1392
  5. package/dist/cjs/loader.cjs.js +4 -4
  6. package/dist/cjs/{luxon-20eafbd9.js → luxon-05098e19.js} +1 -1
  7. package/dist/cjs/mint-components.cjs.js +4 -4
  8. package/dist/cjs/{mockRewardData-3c470512.js → mockRewardData-4258e067.js} +1 -1
  9. package/dist/cjs/{re-render-5de6631a.js → re-render-5bde3d2e.js} +2 -2
  10. package/dist/cjs/sqm-asset-card.cjs.entry.js +3 -3
  11. package/dist/cjs/{sqm-banking-info-form_16.cjs.entry.js → sqm-banking-info-form_17.cjs.entry.js} +1175 -548
  12. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +247 -127
  13. package/dist/cjs/sqm-close-button.cjs.entry.js +3 -3
  14. package/dist/cjs/sqm-context-router.cjs.entry.js +3 -3
  15. package/dist/cjs/sqm-email-verification.cjs.entry.js +150 -20
  16. package/dist/cjs/sqm-empty_4.cjs.entry.js +7 -7
  17. package/dist/cjs/sqm-form-message.cjs.entry.js +2 -2
  18. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +3 -3
  19. package/dist/cjs/sqm-header-logo.cjs.entry.js +2 -2
  20. package/dist/cjs/sqm-instant-access-registration.cjs.entry.js +6 -6
  21. package/dist/cjs/{sqm-invoice-table-view-dbba9bb4.js → sqm-invoice-table-view-4fcf021f.js} +155 -4
  22. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +8 -9
  23. package/dist/cjs/sqm-logout-current-user.cjs.entry.js +7 -8
  24. package/dist/cjs/{sqm-navigation-sidebar-item-view-fc865ecf.js → sqm-navigation-sidebar-item-view-a2135064.js} +1 -1
  25. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +4 -4
  26. package/dist/cjs/sqm-navigation-sidebar.cjs.entry.js +3 -3
  27. package/dist/cjs/sqm-password-field.cjs.entry.js +4 -4
  28. package/dist/cjs/sqm-popup-container.cjs.entry.js +3 -3
  29. package/dist/cjs/{sqm-portal-email-verification-view-4bc2760b.js → sqm-portal-email-verification-view-050dbe0f.js} +1 -1
  30. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +5 -5
  31. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +4 -4
  32. package/dist/cjs/sqm-portal-logout.cjs.entry.js +3 -3
  33. package/dist/cjs/{sqm-portal-profile-view-cbab7c80.js → sqm-portal-profile-view-d97086bc.js} +1 -1
  34. package/dist/cjs/sqm-portal-profile.cjs.entry.js +11 -12
  35. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +3 -3
  36. package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +6 -7
  37. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +4 -4
  38. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +3 -3
  39. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +16 -17
  40. package/dist/cjs/sqm-referred-registration.cjs.entry.js +6 -6
  41. package/dist/cjs/sqm-rewards-table-customer-note-cell.cjs.entry.js +2 -2
  42. package/dist/cjs/sqm-rewards-table-customer-note-column.cjs.entry.js +4 -4
  43. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +61 -62
  44. package/dist/cjs/sqm-scroll.cjs.entry.js +2 -2
  45. package/dist/cjs/sqm-stencilbook.cjs.entry.js +117 -48
  46. package/dist/cjs/sqm-tab.cjs.entry.js +4 -4
  47. package/dist/cjs/sqm-tabs.cjs.entry.js +5 -5
  48. package/dist/cjs/sqm-text-span.cjs.entry.js +2 -2
  49. package/dist/cjs/sqm-widget-verification-controller.cjs.entry.js +113 -0
  50. package/dist/cjs/sqm-widget-verification.cjs.entry.js +168 -107
  51. package/dist/cjs/{stencil-hooks.module-a5a04d8a.js → stencil-hooks.module-72742a0b.js} +4 -1
  52. package/dist/cjs/{useChildElements-23beb180.js → useChildElements-410d2435.js} +2 -2
  53. package/dist/cjs/{useInstantAccessRegistration-7c125c00.js → useInstantAccessRegistration-ccf81eae.js} +3 -3
  54. package/dist/cjs/usePayoutStatus-8f924372.js +1045 -0
  55. package/dist/cjs/{useReferralTable-54d0ba70.js → useReferralTable-824ac152.js} +13 -14
  56. package/dist/cjs/{useRegistrationFormState-e7e820d0.js → useRegistrationFormState-f9ce55be.js} +2 -2
  57. package/dist/cjs/useVerificationEmail-2eb28c2a.js +173 -0
  58. package/dist/cjs/{utilities-ac5b5f2c.js → utilities-f7de6c04.js} +2 -2
  59. package/dist/collection/collection-manifest.json +2 -2
  60. package/dist/collection/components/sqm-big-stat/useBigStat.js +6 -3
  61. package/dist/collection/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.js +7 -0
  62. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.js +2 -1
  63. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +5 -1
  64. package/dist/collection/components/sqm-payout-button-scroll/usePayoutButton.js +3 -10
  65. package/dist/collection/components/sqm-referral-table/ReferralTable.stories.js +7 -1
  66. package/dist/collection/components/sqm-referral-table/ReferralTableRewardsCell.stories.js +16 -4
  67. package/dist/collection/components/sqm-rewards-table/RewardsTableCell.stories.js +7 -12
  68. package/dist/collection/components/sqm-text/sqm-text.js +1 -1
  69. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.js +7 -0
  70. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +2 -2
  71. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +30 -7
  72. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +32 -26
  73. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.js +22 -6
  74. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +10 -6
  75. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.js +37 -10
  76. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +21 -44
  77. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-controller.js +120 -0
  78. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +513 -118
  79. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +169 -0
  80. package/dist/collection/components/tax-and-cash/BankingForm.stories.js +19 -0
  81. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +149 -3
  82. package/dist/collection/components/tax-and-cash/eventKeys.js +1 -0
  83. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +12 -2
  84. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +128 -14
  85. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +15 -1
  86. package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +0 -1
  87. package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.js +12 -2
  88. package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +31 -6
  89. package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +3 -0
  90. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.js +26 -8
  91. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +33 -8
  92. package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +3 -0
  93. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.js +0 -7
  94. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.js +0 -5
  95. package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +0 -56
  96. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +7 -1
  97. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +92 -9
  98. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +269 -6
  99. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +44 -18
  100. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +6 -0
  101. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +55 -22
  102. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -2
  103. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +138 -9
  104. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +283 -17
  105. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +17 -2
  106. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +19 -9
  107. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.js +31 -6
  108. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +16 -11
  109. package/dist/collection/components/tax-and-cash/useVeriffApp.js +64 -0
  110. package/dist/esm/{ShadowViewAddon-72e231a5.js → ShadowViewAddon-69b61037.js} +12 -10
  111. package/dist/esm/extractProps-ae1afbb3.js +19 -0
  112. package/dist/esm/{global-adae7650.js → global-6306a9b8.js} +10 -161
  113. package/dist/esm/{index.module-c0eb7dc2.js → index.module-6c840c4e.js} +222 -1389
  114. package/dist/esm/{keys-a1496e39.js → keys-406491dc.js} +1 -1
  115. package/dist/esm/loader.js +4 -4
  116. package/dist/esm/{luxon-63e24900.js → luxon-7600be8d.js} +1 -1
  117. package/dist/esm/mint-components.js +4 -4
  118. package/dist/esm/{mockRewardData-e6b763d1.js → mockRewardData-0eb6e778.js} +1 -1
  119. package/dist/esm/{re-render-5882a144.js → re-render-1bcfd0de.js} +2 -2
  120. package/dist/esm/sqm-asset-card.entry.js +2 -2
  121. package/dist/esm/{sqm-banking-info-form_16.entry.js → sqm-banking-info-form_17.entry.js} +835 -209
  122. package/dist/esm/sqm-big-stat_39.entry.js +192 -72
  123. package/dist/esm/sqm-close-button.entry.js +2 -2
  124. package/dist/esm/sqm-context-router.entry.js +2 -2
  125. package/dist/esm/sqm-email-verification.entry.js +148 -18
  126. package/dist/esm/sqm-empty_4.entry.js +4 -4
  127. package/dist/esm/sqm-form-message.entry.js +1 -1
  128. package/dist/esm/sqm-graphql-client-provider.entry.js +2 -2
  129. package/dist/esm/sqm-header-logo.entry.js +1 -1
  130. package/dist/esm/sqm-instant-access-registration.entry.js +5 -5
  131. package/dist/esm/{sqm-invoice-table-view-663674f2.js → sqm-invoice-table-view-b3127605.js} +155 -4
  132. package/dist/esm/sqm-leaderboard-rank.entry.js +3 -4
  133. package/dist/esm/sqm-logout-current-user.entry.js +2 -3
  134. package/dist/esm/{sqm-navigation-sidebar-item-view-4715e546.js → sqm-navigation-sidebar-item-view-f8e78810.js} +1 -1
  135. package/dist/esm/sqm-navigation-sidebar-item.entry.js +3 -3
  136. package/dist/esm/sqm-navigation-sidebar.entry.js +2 -2
  137. package/dist/esm/sqm-password-field.entry.js +3 -3
  138. package/dist/esm/sqm-popup-container.entry.js +2 -2
  139. package/dist/esm/{sqm-portal-email-verification-view-598eb9a7.js → sqm-portal-email-verification-view-c6ac5430.js} +1 -1
  140. package/dist/esm/sqm-portal-email-verification.entry.js +4 -4
  141. package/dist/esm/sqm-portal-forgot-password.entry.js +3 -3
  142. package/dist/esm/sqm-portal-logout.entry.js +2 -2
  143. package/dist/esm/{sqm-portal-profile-view-a0f6ad48.js → sqm-portal-profile-view-15ddbec8.js} +1 -1
  144. package/dist/esm/sqm-portal-profile.entry.js +5 -6
  145. package/dist/esm/sqm-portal-protected-route.entry.js +2 -2
  146. package/dist/esm/sqm-portal-registration-form.entry.js +4 -5
  147. package/dist/esm/sqm-portal-reset-password.entry.js +3 -3
  148. package/dist/esm/sqm-portal-verify-email.entry.js +2 -2
  149. package/dist/esm/sqm-referral-table_11.entry.js +8 -9
  150. package/dist/esm/sqm-referred-registration.entry.js +5 -5
  151. package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  152. package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +3 -3
  153. package/dist/esm/sqm-rewards-table_9.entry.js +8 -9
  154. package/dist/esm/sqm-scroll.entry.js +1 -1
  155. package/dist/esm/sqm-stencilbook.entry.js +115 -46
  156. package/dist/esm/sqm-tab.entry.js +3 -3
  157. package/dist/esm/sqm-tabs.entry.js +4 -4
  158. package/dist/esm/sqm-text-span.entry.js +1 -1
  159. package/dist/esm/sqm-widget-verification-controller.entry.js +109 -0
  160. package/dist/esm/sqm-widget-verification.entry.js +169 -108
  161. package/dist/esm/{stencil-hooks.module-3c7f7c90.js → stencil-hooks.module-ac12ca1c.js} +1 -1
  162. package/dist/esm/{useChildElements-fe94b660.js → useChildElements-fc84e640.js} +2 -2
  163. package/dist/esm/{useInstantAccessRegistration-670c1b98.js → useInstantAccessRegistration-8b0a4556.js} +3 -3
  164. package/dist/esm/usePayoutStatus-0bc0380f.js +1039 -0
  165. package/dist/esm/{useReferralTable-52008143.js → useReferralTable-f6ffa103.js} +4 -5
  166. package/dist/esm/{useRegistrationFormState-4cfd1a8d.js → useRegistrationFormState-849e27f7.js} +2 -2
  167. package/dist/esm/useVerificationEmail-2a21d0e3.js +171 -0
  168. package/dist/esm/{utilities-98445452.js → utilities-443732be.js} +2 -2
  169. package/dist/esm-es5/ShadowViewAddon-69b61037.js +1 -0
  170. package/dist/esm-es5/extractProps-ae1afbb3.js +1 -0
  171. package/dist/esm-es5/global-6306a9b8.js +285 -0
  172. package/dist/esm-es5/index.module-6c840c4e.js +1 -0
  173. package/dist/esm-es5/{keys-a1496e39.js → keys-406491dc.js} +1 -1
  174. package/dist/esm-es5/loader.js +1 -1
  175. package/dist/esm-es5/{luxon-63e24900.js → luxon-7600be8d.js} +1 -1
  176. package/dist/esm-es5/mint-components.js +1 -1
  177. package/dist/esm-es5/{mockRewardData-e6b763d1.js → mockRewardData-0eb6e778.js} +1 -1
  178. package/dist/esm-es5/{re-render-5882a144.js → re-render-1bcfd0de.js} +1 -1
  179. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  180. package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -0
  181. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  182. package/dist/esm-es5/sqm-close-button.entry.js +1 -1
  183. package/dist/esm-es5/sqm-context-router.entry.js +1 -1
  184. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  185. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  186. package/dist/esm-es5/sqm-form-message.entry.js +1 -1
  187. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  188. package/dist/esm-es5/sqm-header-logo.entry.js +1 -1
  189. package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
  190. package/dist/esm-es5/sqm-invoice-table-view-b3127605.js +1 -0
  191. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  192. package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
  193. package/dist/esm-es5/{sqm-navigation-sidebar-item-view-4715e546.js → sqm-navigation-sidebar-item-view-f8e78810.js} +1 -1
  194. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  195. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  196. package/dist/esm-es5/sqm-password-field.entry.js +1 -1
  197. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  198. package/dist/esm-es5/{sqm-portal-email-verification-view-598eb9a7.js → sqm-portal-email-verification-view-c6ac5430.js} +1 -1
  199. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  200. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  201. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  202. package/dist/esm-es5/{sqm-portal-profile-view-a0f6ad48.js → sqm-portal-profile-view-15ddbec8.js} +1 -1
  203. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  204. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  205. package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
  206. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  207. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  208. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  209. package/dist/esm-es5/sqm-referred-registration.entry.js +1 -1
  210. package/dist/esm-es5/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  211. package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
  212. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  213. package/dist/esm-es5/sqm-scroll.entry.js +1 -1
  214. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  215. package/dist/esm-es5/sqm-tab.entry.js +1 -1
  216. package/dist/esm-es5/sqm-tabs.entry.js +1 -1
  217. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  218. package/dist/esm-es5/sqm-widget-verification-controller.entry.js +1 -0
  219. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  220. package/dist/esm-es5/{stencil-hooks.module-3c7f7c90.js → stencil-hooks.module-ac12ca1c.js} +1 -1
  221. package/dist/esm-es5/useChildElements-fc84e640.js +1 -0
  222. package/dist/esm-es5/{useInstantAccessRegistration-670c1b98.js → useInstantAccessRegistration-8b0a4556.js} +1 -1
  223. package/dist/esm-es5/usePayoutStatus-0bc0380f.js +6 -0
  224. package/dist/esm-es5/useReferralTable-f6ffa103.js +1 -0
  225. package/dist/esm-es5/useRegistrationFormState-849e27f7.js +1 -0
  226. package/dist/esm-es5/useVerificationEmail-2a21d0e3.js +1 -0
  227. package/dist/esm-es5/{utilities-98445452.js → utilities-443732be.js} +1 -1
  228. package/dist/mint-components/mint-components.esm.js +1 -1
  229. package/dist/mint-components/mint-components.js +1 -1
  230. package/dist/mint-components/{p-0ecb3019.js → p-0121e044.js} +1 -1
  231. package/dist/mint-components/p-012daf3c.entry.js +1 -0
  232. package/dist/mint-components/p-021ccc29.entry.js +25 -0
  233. package/dist/mint-components/{p-1e40967f.entry.js → p-03dbe2ce.entry.js} +1 -1
  234. package/dist/mint-components/{p-65a449de.js → p-04348a9b.js} +1 -1
  235. package/dist/mint-components/{p-14488d1c.system.entry.js → p-04ced592.system.entry.js} +1 -1
  236. package/dist/mint-components/{p-78a831e0.system.entry.js → p-0527d90b.system.entry.js} +1 -1
  237. package/dist/mint-components/p-0893073b.entry.js +1 -0
  238. package/dist/mint-components/p-0a94fe9f.system.entry.js +1 -0
  239. package/dist/mint-components/p-0c9ad5f3.system.entry.js +1 -0
  240. package/dist/mint-components/p-11d1b212.js +1 -0
  241. package/dist/mint-components/p-156e37c2.system.entry.js +1 -0
  242. package/dist/mint-components/{p-cdd04337.entry.js → p-178d2d2e.entry.js} +1 -1
  243. package/dist/mint-components/{p-ee328054.entry.js → p-1b861be5.entry.js} +1 -1
  244. package/dist/mint-components/{p-4209cd94.js → p-1d27da33.js} +4 -4
  245. package/dist/mint-components/{p-5a2fd8e0.system.entry.js → p-1f7d7524.system.entry.js} +1 -1
  246. package/dist/mint-components/{p-f0fba496.system.entry.js → p-22425c71.system.entry.js} +1 -1
  247. package/dist/mint-components/{p-9223640e.js → p-251e7567.js} +1 -1
  248. package/dist/mint-components/p-26468242.js +1 -0
  249. package/dist/mint-components/{p-1602bf01.js → p-2816bf6a.js} +1 -1
  250. package/dist/mint-components/p-2868f475.entry.js +1 -0
  251. package/dist/mint-components/{p-0979f82e.system.js → p-2a414b2e.system.js} +2 -2
  252. package/dist/mint-components/p-2c342de3.system.entry.js +1 -0
  253. package/dist/mint-components/p-3007fb7d.system.entry.js +1 -0
  254. package/dist/mint-components/p-36e9296e.system.entry.js +1 -0
  255. package/dist/mint-components/{p-cb45d0a8.system.js → p-370a1a73.system.js} +1 -1
  256. package/dist/mint-components/p-38c7775a.js +1 -0
  257. package/dist/mint-components/p-3925bcd6.entry.js +13 -0
  258. package/dist/mint-components/{p-45d0b48a.system.entry.js → p-3e7ec0f3.system.entry.js} +1 -1
  259. package/dist/mint-components/{p-423821b9.system.js → p-43621f12.system.js} +1 -1
  260. package/dist/mint-components/p-478a3755.entry.js +9 -0
  261. package/dist/mint-components/p-47b47e3b.js +31 -0
  262. package/dist/mint-components/{p-f338ef55.system.js → p-4babe350.system.js} +1 -1
  263. package/dist/mint-components/{p-34a87e67.system.js → p-4e373c3d.system.js} +1 -1
  264. package/dist/mint-components/{p-ab89b44a.system.js → p-4eae91a9.system.js} +1 -1
  265. package/dist/mint-components/{p-ab7322f0.system.entry.js → p-51d53165.system.entry.js} +1 -1
  266. package/dist/mint-components/{p-4c0b7768.entry.js → p-5291891c.entry.js} +3 -3
  267. package/dist/mint-components/{p-4c9b6fbe.system.js → p-57dd28bd.system.js} +1 -1
  268. package/dist/mint-components/{p-34dab223.system.entry.js → p-59818690.system.entry.js} +1 -1
  269. package/dist/mint-components/{p-00ec17d4.system.js → p-5becb2ff.system.js} +1 -1
  270. package/dist/mint-components/{p-a1f0d8ba.system.entry.js → p-5fba1a04.system.entry.js} +1 -1
  271. package/dist/mint-components/p-64491210.system.entry.js +1 -0
  272. package/dist/mint-components/{p-def70672.js → p-68747d88.js} +1 -1
  273. package/dist/mint-components/{p-95af445c.system.entry.js → p-6afb4f48.system.entry.js} +1 -1
  274. package/dist/mint-components/{p-cafebf8a.entry.js → p-6c928c7d.entry.js} +1 -1
  275. package/dist/mint-components/{p-70886c65.system.entry.js → p-70af9ba2.system.entry.js} +1 -1
  276. package/dist/mint-components/{p-657b290b.entry.js → p-76392386.entry.js} +1 -1
  277. package/dist/mint-components/p-7dd1ff31.system.entry.js +1 -0
  278. package/dist/mint-components/{p-d0c4f3bf.system.entry.js → p-83c9f37b.system.entry.js} +1 -1
  279. package/dist/mint-components/{p-cdcd825e.entry.js → p-84b25a46.entry.js} +1 -1
  280. package/dist/mint-components/{p-14beec1b.system.entry.js → p-88aac6a9.system.entry.js} +1 -1
  281. package/dist/mint-components/{p-45d6cde6.system.entry.js → p-88bf51b7.system.entry.js} +1 -1
  282. package/dist/mint-components/p-8d554a89.system.js +1 -0
  283. package/dist/mint-components/p-93576222.system.js +1 -0
  284. package/dist/mint-components/p-9379ee08.js +48 -0
  285. package/dist/mint-components/{p-d2a925d5.entry.js → p-94454880.entry.js} +1 -1
  286. package/dist/mint-components/{p-3ba349a3.entry.js → p-947fe79b.entry.js} +1 -1
  287. package/dist/mint-components/p-97c92e75.entry.js +16 -0
  288. package/dist/mint-components/p-99c15c5e.entry.js +1 -0
  289. package/dist/mint-components/p-9bd417fd.entry.js +1 -0
  290. package/dist/mint-components/{p-c293f586.system.entry.js → p-9cdbd1ac.system.entry.js} +1 -1
  291. package/dist/mint-components/{p-56b37aeb.entry.js → p-9d34f4f0.entry.js} +3 -3
  292. package/dist/mint-components/{p-64acc813.entry.js → p-9e0230c3.entry.js} +1 -1
  293. package/dist/mint-components/{p-8ccb4267.js → p-9eae245f.js} +30 -27
  294. package/dist/mint-components/p-a4282d02.system.entry.js +1 -0
  295. package/dist/mint-components/{p-a2e1af83.entry.js → p-a45b03d2.entry.js} +1 -1
  296. package/dist/mint-components/{p-15e01e7a.entry.js → p-a85f57bb.entry.js} +1 -1
  297. package/dist/mint-components/p-a8645c1b.system.js +1 -0
  298. package/dist/mint-components/p-a8c28561.system.js +1 -0
  299. package/dist/mint-components/p-a954c299.entry.js +205 -0
  300. package/dist/mint-components/{p-dce3d296.system.js → p-ac51940e.system.js} +1 -1
  301. package/dist/mint-components/{p-d39da925.entry.js → p-b1e8a802.entry.js} +1 -1
  302. package/dist/mint-components/p-b3b5b4b7.system.entry.js +1 -0
  303. package/dist/mint-components/{p-3da2b3cf.system.entry.js → p-bc826117.system.entry.js} +1 -1
  304. package/dist/mint-components/p-bd1372d2.system.js +6 -0
  305. package/dist/mint-components/p-bdd6bb13.js +1 -0
  306. package/dist/mint-components/{p-3c46b3de.system.entry.js → p-be1ae1ed.system.entry.js} +1 -1
  307. package/dist/mint-components/{p-cadb8dba.entry.js → p-bee1e573.entry.js} +1 -1
  308. package/dist/mint-components/{p-18cd88c4.system.entry.js → p-c1f4fb6d.system.entry.js} +1 -1
  309. package/dist/mint-components/p-c1fa5e04.system.js +1 -0
  310. package/dist/mint-components/{p-7507d72b.js → p-c3b37bbf.js} +1 -1
  311. package/dist/mint-components/{p-ac69b460.system.entry.js → p-c3babfa4.system.entry.js} +1 -1
  312. package/dist/mint-components/p-c8878e79.entry.js +1 -0
  313. package/dist/mint-components/p-c92a743e.entry.js +1 -0
  314. package/dist/mint-components/p-c9fb6102.entry.js +1 -0
  315. package/dist/mint-components/p-ca809fdd.system.js +1 -0
  316. package/dist/mint-components/p-cb433855.system.entry.js +1 -0
  317. package/dist/mint-components/p-cb55d3c4.system.entry.js +1 -0
  318. package/dist/mint-components/{p-6a70d2d6.entry.js → p-cd200c95.entry.js} +1 -1
  319. package/dist/mint-components/{p-06c561ea.system.js → p-cd44de66.system.js} +1 -1
  320. package/dist/mint-components/{p-e5299352.system.js → p-ce9e7c98.system.js} +1 -1
  321. package/dist/mint-components/p-d35d8c06.entry.js +11 -0
  322. package/dist/mint-components/p-d468925f.entry.js +1 -0
  323. package/dist/mint-components/p-d4877a65.system.entry.js +1 -0
  324. package/dist/mint-components/{p-0db003f7.js → p-d83b0cf3.js} +153 -153
  325. package/dist/mint-components/{p-5c602e84.entry.js → p-dd0d79bf.entry.js} +1 -1
  326. package/dist/mint-components/p-def516b8.system.js +1 -0
  327. package/dist/mint-components/p-e01ac27c.system.js +1 -0
  328. package/dist/mint-components/{p-611a30f0.js → p-e0e7635a.js} +1 -1
  329. package/dist/mint-components/p-e12d3414.system.entry.js +1 -0
  330. package/dist/mint-components/{p-816fb64f.system.entry.js → p-ead27698.system.entry.js} +1 -1
  331. package/dist/mint-components/{p-7ab14d4b.system.entry.js → p-f0806232.system.entry.js} +1 -1
  332. package/dist/mint-components/p-f1184442.js +1 -0
  333. package/dist/mint-components/p-f196d71a.entry.js +241 -0
  334. package/dist/mint-components/{p-48704504.js → p-f3053c61.js} +1 -1
  335. package/dist/mint-components/p-f36e33ff.entry.js +13 -0
  336. package/dist/mint-components/p-f450654b.system.entry.js +1 -0
  337. package/dist/mint-components/p-f4cbbe47.entry.js +1 -0
  338. package/dist/mint-components/p-f531a5c9.system.entry.js +1 -0
  339. package/dist/mint-components/{p-b14a77e8.system.entry.js → p-f56348dc.system.entry.js} +1 -1
  340. package/dist/mint-components/p-f655a7df.js +1 -0
  341. package/dist/mint-components/{p-79097c07.entry.js → p-fbdf0738.entry.js} +1 -1
  342. package/dist/mint-components/{p-fda3d0ca.system.js → p-fc422446.system.js} +22 -22
  343. package/dist/mint-components/p-fd21ae8f.entry.js +1 -0
  344. package/dist/mint-components/{p-1b24bb52.js → p-fd2c5407.js} +1 -1
  345. package/dist/types/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.d.ts +1 -0
  346. package/dist/types/components/sqm-referral-table/ReferralTableRewardsCell.stories.d.ts +1 -0
  347. package/dist/types/components/sqm-rewards-table/RewardsTableCell.stories.d.ts +1 -0
  348. package/dist/types/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.d.ts +1 -0
  349. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.d.ts +1 -0
  350. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +4 -0
  351. package/dist/types/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.d.ts +2 -1
  352. package/dist/types/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.d.ts +1 -0
  353. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.d.ts +1 -0
  354. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.d.ts +4 -0
  355. package/dist/types/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.d.ts +0 -6
  356. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-controller.d.ts +12 -0
  357. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +79 -1
  358. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +15 -0
  359. package/dist/types/components/tax-and-cash/BankingForm.stories.d.ts +1 -0
  360. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +5 -0
  361. package/dist/types/components/tax-and-cash/eventKeys.d.ts +1 -0
  362. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +7 -0
  363. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +13 -0
  364. package/dist/types/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.d.ts +1 -0
  365. package/dist/types/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.d.ts +4 -0
  366. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form-view.d.ts +1 -0
  367. package/dist/types/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.d.ts +4 -0
  368. package/dist/types/components/tax-and-cash/sqm-payout-details-card/PayoutDetailsCard.stories.d.ts +0 -1
  369. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card-view.d.ts +0 -4
  370. package/dist/types/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.d.ts +1 -16
  371. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +4 -0
  372. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +18 -0
  373. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +46 -0
  374. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +12 -1
  375. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/data.d.ts +6 -0
  376. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/extractProps.d.ts +5 -1
  377. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +15 -3
  378. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +17 -2
  379. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +47 -2
  380. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.d.ts +1 -0
  381. package/dist/types/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form.d.ts +4 -0
  382. package/dist/types/components/tax-and-cash/useVeriffApp.d.ts +6 -0
  383. package/dist/types/components.d.ts +461 -83
  384. package/docs/docs.docx +0 -0
  385. package/docs/raisins.json +1 -1
  386. package/grapesjs/grapesjs.js +1 -1
  387. package/package.json +2 -1
  388. package/dist/cjs/index-56d1fa5b.js +0 -2227
  389. package/dist/cjs/sqm-code-verification.cjs.entry.js +0 -356
  390. package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +0 -33
  391. package/dist/cjs/useEmailVerification-33465f36.js +0 -155
  392. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +0 -27
  393. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +0 -3
  394. package/dist/esm/index-0c7b14c5.js +0 -2225
  395. package/dist/esm/sqm-code-verification.entry.js +0 -352
  396. package/dist/esm/sqm-widget-verification-internal.entry.js +0 -29
  397. package/dist/esm/useEmailVerification-8f2dc2bd.js +0 -152
  398. package/dist/esm-es5/ShadowViewAddon-72e231a5.js +0 -1
  399. package/dist/esm-es5/global-adae7650.js +0 -285
  400. package/dist/esm-es5/index-0c7b14c5.js +0 -1
  401. package/dist/esm-es5/index.module-c0eb7dc2.js +0 -53
  402. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +0 -1
  403. package/dist/esm-es5/sqm-code-verification.entry.js +0 -1
  404. package/dist/esm-es5/sqm-invoice-table-view-663674f2.js +0 -1
  405. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +0 -1
  406. package/dist/esm-es5/useChildElements-fe94b660.js +0 -1
  407. package/dist/esm-es5/useEmailVerification-8f2dc2bd.js +0 -1
  408. package/dist/esm-es5/useReferralTable-52008143.js +0 -1
  409. package/dist/esm-es5/useRegistrationFormState-4cfd1a8d.js +0 -1
  410. package/dist/mint-components/p-0078bc76.system.js +0 -53
  411. package/dist/mint-components/p-18399da0.system.entry.js +0 -1
  412. package/dist/mint-components/p-1f02e20b.entry.js +0 -1
  413. package/dist/mint-components/p-253c87e1.system.entry.js +0 -1
  414. package/dist/mint-components/p-25a70095.system.entry.js +0 -1
  415. package/dist/mint-components/p-2632464d.entry.js +0 -1
  416. package/dist/mint-components/p-286190c4.system.entry.js +0 -1
  417. package/dist/mint-components/p-414b3b6c.system.entry.js +0 -1
  418. package/dist/mint-components/p-4185f6f5.system.entry.js +0 -1
  419. package/dist/mint-components/p-4d060f15.js +0 -1
  420. package/dist/mint-components/p-52241ba9.system.js +0 -1
  421. package/dist/mint-components/p-556753b2.js +0 -42
  422. package/dist/mint-components/p-55dcb6ff.system.js +0 -1
  423. package/dist/mint-components/p-65de8fb2.js +0 -1
  424. package/dist/mint-components/p-6cae44d7.js +0 -1
  425. package/dist/mint-components/p-6eede6e5.system.entry.js +0 -1
  426. package/dist/mint-components/p-6fbfd683.js +0 -1
  427. package/dist/mint-components/p-78c1bd77.system.js +0 -1
  428. package/dist/mint-components/p-7c4c727c.system.entry.js +0 -1
  429. package/dist/mint-components/p-7e5f0292.system.entry.js +0 -1
  430. package/dist/mint-components/p-832eba3a.entry.js +0 -1
  431. package/dist/mint-components/p-858a87ce.entry.js +0 -1
  432. package/dist/mint-components/p-89669879.system.js +0 -1
  433. package/dist/mint-components/p-8b7d2f44.entry.js +0 -1
  434. package/dist/mint-components/p-8d696fc9.entry.js +0 -189
  435. package/dist/mint-components/p-8da20810.entry.js +0 -240
  436. package/dist/mint-components/p-8defb972.system.entry.js +0 -1
  437. package/dist/mint-components/p-99a09fab.entry.js +0 -9
  438. package/dist/mint-components/p-9cdaa099.entry.js +0 -1
  439. package/dist/mint-components/p-a80c8f5c.system.js +0 -1
  440. package/dist/mint-components/p-a9487844.system.entry.js +0 -1
  441. package/dist/mint-components/p-b28df069.js +0 -1
  442. package/dist/mint-components/p-b4771476.entry.js +0 -1
  443. package/dist/mint-components/p-c9ca8473.system.entry.js +0 -1
  444. package/dist/mint-components/p-cac64545.system.entry.js +0 -1
  445. package/dist/mint-components/p-d3293ac3.entry.js +0 -11
  446. package/dist/mint-components/p-d4138847.system.entry.js +0 -1
  447. package/dist/mint-components/p-d70bfe30.entry.js +0 -8
  448. package/dist/mint-components/p-d7b701a7.entry.js +0 -1
  449. package/dist/mint-components/p-d90ef1da.system.entry.js +0 -1
  450. package/dist/mint-components/p-e05ff098.system.js +0 -1
  451. package/dist/mint-components/p-e4c3817a.system.entry.js +0 -1
  452. package/dist/mint-components/p-e7797040.entry.js +0 -1
  453. package/dist/mint-components/p-e810da97.entry.js +0 -1
  454. package/dist/mint-components/p-e82eec3c.entry.js +0 -13
  455. package/dist/mint-components/p-e8bfd924.system.entry.js +0 -1
  456. package/dist/mint-components/p-e8fcaaa2.entry.js +0 -13
  457. package/dist/mint-components/p-ef49d744.entry.js +0 -1
  458. package/dist/mint-components/p-f5f0fc0e.entry.js +0 -1
  459. package/dist/mint-components/p-faf019cf.system.js +0 -1
  460. package/dist/mint-components/p-fcb224ab.js +0 -25
  461. package/dist/mint-components/p-fe8e1071.entry.js +0 -1
  462. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-internal.d.ts +0 -5
  463. package/dist/types/components/sqm-widget-verification/useWidgetVerification.d.ts +0 -1
@@ -1,12 +1,14 @@
1
1
  import { useMutation, useParent, useParentValue, useUserIdentity, } from "@saasquatch/component-boilerplate";
2
2
  import { useEffect, useHost, useState } from "@saasquatch/stencil-hooks";
3
3
  import { gql } from "graphql-request";
4
- import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE, VERIFICATION_EVENT_KEY, } from "../keys";
5
- import { useVerificationEmailMutation } from "../sqm-email-verification/useEmailVerification";
6
- // TODO: Move to component-boilerplate
4
+ import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE, } from "../keys";
5
+ import { useVerificationEmail } from "../useVerificationEmail";
7
6
  export const VerifyEmailWithCodeMutation = gql `
8
- mutation verifyUserEmail($user: UserIdInput!, $code: String!) {
9
- verifyUserEmail(user: $user, code: $code) {
7
+ mutation submitImpactPublisherEmail2FACode(
8
+ $user: UserIdInput!
9
+ $code: String!
10
+ ) {
11
+ submitImpactPublisherEmail2FACode(user: $user, code: $code) {
10
12
  verifiedEmail
11
13
  accessKey
12
14
  }
@@ -44,9 +46,7 @@ export function useWidgetCodeVerification(props) {
44
46
  const [codeRef, setCodeRef] = useState(null);
45
47
  const [validationError, setValidationError] = useState(false);
46
48
  const [emailError, setEmailError] = useState(false);
47
- // TODO: Need to handle error states for these errors
48
- const [verifyUser, { loading: verifyLoading, errors: verifyErrors }] = useCodeVerificationMutation();
49
- const [request, { loading: resendLoading, data, errors: resendErrors }] = useVerificationEmailMutation();
49
+ const { initialized, verificationEmail, send: [sendEmail, { loading: sendLoading, errors: sendErrors }], verify: [verifyEmail, { loading: verifyLoading, errors: verifyErrors }], } = useVerificationEmail();
50
50
  useEffect(() => {
51
51
  if (!codeRef)
52
52
  return;
@@ -62,18 +62,20 @@ export function useWidgetCodeVerification(props) {
62
62
  }
63
63
  });
64
64
  element.addEventListener("input", (e) => {
65
- const input = e.target.value;
65
+ const input = e.data;
66
66
  if (!input)
67
67
  return;
68
68
  if (idx === codeElements.length - 1) {
69
- e.target.value = input.slice(-1);
69
+ e.target.value = input.slice(0, 1);
70
70
  return;
71
71
  }
72
72
  if (input.length > 1) {
73
73
  const rest = input.slice(1);
74
74
  e.target.value = input.slice(0, 1);
75
- codeElements[idx + 1].value = rest;
76
- codeElements[idx + 1].dispatchEvent(new Event("input"));
75
+ codeElements[idx + 1].dispatchEvent(new InputEvent("input", {
76
+ inputType: "insertFromPaste",
77
+ data: rest,
78
+ }));
77
79
  }
78
80
  codeElements[idx + 1].focus();
79
81
  });
@@ -84,7 +86,10 @@ export function useWidgetCodeVerification(props) {
84
86
  setValidationError(false);
85
87
  };
86
88
  const resendEmail = async () => {
87
- const result = await request();
89
+ // UI should only allow this to be called if initialized, but checking just in case
90
+ if (!initialized)
91
+ return;
92
+ const result = await sendEmail();
88
93
  if (!result) {
89
94
  setEmailError(true);
90
95
  return;
@@ -104,16 +109,13 @@ export function useWidgetCodeVerification(props) {
104
109
  codeElements.forEach((element) => {
105
110
  code = `${code}${element.value}`;
106
111
  });
112
+ // UI should only allow this to be called if initialized, but checking just in case
113
+ if (!initialized)
114
+ return;
107
115
  setValidationError(false);
108
- // Only 123456 passes for a valid code rn
109
- const res = await verifyUser(code);
110
- if (res) {
111
- const event = new CustomEvent(VERIFICATION_EVENT_KEY, {
112
- detail: { token: res.verifyUserEmail.accessKey },
113
- composed: true,
114
- bubbles: true,
115
- });
116
- host.dispatchEvent(event);
116
+ const res = await verifyEmail(code);
117
+ if (res === null || res === void 0 ? void 0 : res.success) {
118
+ props.onVerification(res.accessKey);
117
119
  reset();
118
120
  }
119
121
  else {
@@ -121,21 +123,25 @@ export function useWidgetCodeVerification(props) {
121
123
  }
122
124
  };
123
125
  useEffect(() => {
126
+ // Wait for mutations to be determined from user lookup
127
+ if (!initialized)
128
+ return;
124
129
  // email should already exist if user has completed email-verification
125
130
  if (!email)
126
131
  resendEmail();
127
132
  else
128
133
  setEmailSent(true);
129
- }, []);
134
+ }, [initialized]);
130
135
  return {
131
136
  refs: {
132
137
  codeWrapperRef: setCodeRef,
133
138
  },
134
139
  states: {
135
- email,
140
+ email: verificationEmail,
136
141
  emailResent,
137
- resendError: !!(resendErrors === null || resendErrors === void 0 ? void 0 : resendErrors.message) || emailError,
138
- loading: verifyLoading || resendLoading,
142
+ resendError: sendErrors || verifyErrors,
143
+ initialiseLoading: !initialized,
144
+ loading: sendLoading || verifyLoading,
139
145
  verifyFailed: !!validationError,
140
146
  },
141
147
  callbacks: {
@@ -10,12 +10,17 @@ const defaultProps = {
10
10
  sendCodeError: false,
11
11
  };
12
12
  export const Default = () => (h("sqm-email-verification", { demoData: {} }));
13
- export const EmailIsPrefilled = () => (h("sqm-email-verification", { demoData: {
14
- states: {
15
- ...defaultProps,
16
- email: "test@example.com",
17
- },
18
- } }));
13
+ export const EmailIsPrefilled = () => (h("div", null,
14
+ h("sqm-text", null,
15
+ h("h4", null, "Verify your email")),
16
+ h("sqm-text", null,
17
+ h("sub", null, "To get your cash paid out directly to your bank account, please complete your account setup")),
18
+ h("sqm-email-verification", { demoData: {
19
+ states: {
20
+ ...defaultProps,
21
+ email: "test@example.com",
22
+ },
23
+ } })));
19
24
  export const Loading = () => (h("sqm-email-verification", { demoData: {
20
25
  states: {
21
26
  ...defaultProps,
@@ -28,6 +33,17 @@ export const SaveLoading = () => (h("sqm-email-verification", { demoData: {
28
33
  loading: true,
29
34
  },
30
35
  } }));
36
+ export const WithHeader = () => (h("div", null,
37
+ h("sqm-text", null,
38
+ h("h4", null, "Verify your email")),
39
+ h("sqm-text", null,
40
+ h("sub", null, "To get your cash paid out directly to your bank account, please complete your account setup")),
41
+ h("sqm-email-verification", { demoData: {
42
+ states: {
43
+ ...defaultProps,
44
+ email: "test@example.com",
45
+ },
46
+ } })));
31
47
  export const InvalidEmail = () => (h("sqm-email-verification", { demoData: {
32
48
  states: {
33
49
  ...defaultProps,
@@ -1,6 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { createStyleSheet } from "../../../styling/JSS";
3
3
  import { TextSpanView } from "../../sqm-text-span/sqm-text-span-view";
4
+ import { intl } from "../../../global/global";
4
5
  const style = {
5
6
  Wrapper: {
6
7
  display: "flex",
@@ -20,10 +21,7 @@ const style = {
20
21
  backgroundColor: "var(--sl-color-red-100)",
21
22
  borderTop: "none",
22
23
  },
23
- "&::part(message)": {
24
- display: "flex",
25
- flexDirection: "column",
26
- },
24
+ "&::part(message)": {},
27
25
  },
28
26
  ContinueButton: {
29
27
  width: "100%",
@@ -76,12 +74,18 @@ export function WidgetEmailVerificationView(props) {
76
74
  states.sendCodeError && (h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "danger", class: sheet.classes.ErrorAlertContainer, open: true },
77
75
  h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
78
76
  h("b", null, text.sendCodeErrorHeader),
79
- text.sendCodeErrorDescription)),
77
+ h("br", null),
78
+ intl.formatMessage({
79
+ id: "sendCodeErrorDescription",
80
+ defaultMessage: text.sendCodeErrorDescription,
81
+ }, {
82
+ supportLink: (h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
83
+ }))),
80
84
  states.initialLoading ? (renderLoadingSkeleton()) : (h("div", { class: sheet.classes.Wrapper },
81
85
  h(TextSpanView, { type: "p" }, text.verifyEmailHeaderText),
82
86
  h("sl-form", { "onSl-submit": callbacks.submitEmail },
83
87
  h("div", { class: sheet.classes.InputsContainer },
84
- h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.emailLabel, value: states.email, type: "email", id: "email", name: "email", disabled: !!states.email || states.loading }, (states.error
88
+ h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.emailLabel, value: states.email || "", type: "email", id: "email", name: "email", disabled: !!states.email || states.loading }, (states.error
85
89
  ? {
86
90
  class: sheet.classes.ErrorInput,
87
91
  helpText: text.emailValidationErrorText,
@@ -3,8 +3,9 @@ import { Component, h, Prop } from "@stencil/core";
3
3
  import { useWidgetEmailVerification } from "./useEmailVerification";
4
4
  import { WidgetEmailVerificationView, } from "./sqm-email-verification-view";
5
5
  import { getProps } from "../../../utils/utils";
6
- import { isDemo } from "@saasquatch/component-boilerplate";
6
+ import { isDemo, useSetParent } from "@saasquatch/component-boilerplate";
7
7
  import deepmerge from "deepmerge";
8
+ import { SHOW_CODE_NAMESPACE } from "../keys";
8
9
  /**
9
10
  * @uiName Widget Verification Gate
10
11
  */
@@ -17,11 +18,15 @@ export class WidgetEmailVerification {
17
18
  /**
18
19
  * @uiName Send code to email alert header
19
20
  */
20
- this.sendCodeErrorHeader = "There was an error sending your code.";
21
+ this.sendCodeErrorHeader = "There was an error sending your code";
22
+ /**
23
+ * @uiName Support link text
24
+ */
25
+ this.supportLink = "support team";
21
26
  /**
22
27
  * @uiName Send code to email alert description
23
28
  */
24
- this.sendCodeErrorDescription = "Please try again. If this problem continues, contact our program support team.";
29
+ this.sendCodeErrorDescription = "Please try again. If this problem continues, contact our program {supportLink}.";
25
30
  /**
26
31
  * @uiName Email input label
27
32
  */
@@ -89,7 +94,28 @@ export class WidgetEmailVerification {
89
94
  },
90
95
  "attribute": "send-code-error-header",
91
96
  "reflect": false,
92
- "defaultValue": "\"There was an error sending your code.\""
97
+ "defaultValue": "\"There was an error sending your code\""
98
+ },
99
+ "supportLink": {
100
+ "type": "string",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "string",
104
+ "resolved": "string",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [{
111
+ "text": "Support link text",
112
+ "name": "uiName"
113
+ }],
114
+ "text": ""
115
+ },
116
+ "attribute": "support-link",
117
+ "reflect": false,
118
+ "defaultValue": "\"support team\""
93
119
  },
94
120
  "sendCodeErrorDescription": {
95
121
  "type": "string",
@@ -110,7 +136,7 @@ export class WidgetEmailVerification {
110
136
  },
111
137
  "attribute": "send-code-error-description",
112
138
  "reflect": false,
113
- "defaultValue": "\"Please try again. If this problem continues, contact our program support team.\""
139
+ "defaultValue": "\"Please try again. If this problem continues, contact our program {supportLink}.\""
114
140
  },
115
141
  "emailLabel": {
116
142
  "type": "string",
@@ -208,16 +234,17 @@ export class WidgetEmailVerification {
208
234
  }; }
209
235
  }
210
236
  function useDemoWidgetEmailVerification(props) {
237
+ const setShowCode = useSetParent(SHOW_CODE_NAMESPACE);
211
238
  return deepmerge({
212
239
  states: {
213
- error: "",
240
+ error: true,
241
+ initialLoading: false,
214
242
  loading: false,
215
- email: "",
216
- isEmailPrefilled: false,
217
- sendCodeError: false,
243
+ email: "test@example.com",
244
+ sendCodeError: true,
218
245
  },
219
246
  callbacks: {
220
- submitEmail: async () => { },
247
+ submitEmail: async () => setShowCode(true),
221
248
  },
222
249
  text: props.getTextProps(),
223
250
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
@@ -2,16 +2,10 @@ import { useMutation, useParent, useQuery, useUserIdentity, } from "@saasquatch/
2
2
  import { useEffect, useState } from "@saasquatch/universal-hooks";
3
3
  import { gql } from "graphql-request";
4
4
  import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE } from "../keys";
5
- export const VerificationEmailMutation = gql `
6
- mutation requestUserEmailVerification($user: UserIdInput!) {
7
- requestUserEmailVerification(user: $user) {
8
- success
9
- }
10
- }
11
- `;
5
+ import { useVerificationEmail } from "../useVerificationEmail";
12
6
  export const UpsertUserEmailMutation = gql `
13
7
  mutation upsertUser($userInput: UserInput!) {
14
- user(userInput: $userInput) {
8
+ upsertUser(userInput: $userInput) {
15
9
  id
16
10
  accountId
17
11
  email
@@ -25,47 +19,23 @@ export const UserLookupQuery = gql `
25
19
  id
26
20
  accountId
27
21
  email
22
+ impactConnection {
23
+ user {
24
+ id
25
+ email
26
+ }
27
+ }
28
28
  }
29
29
  }
30
30
  }
31
31
  `;
32
- // TODO: Move to component-boilerplate
33
- export function useVerificationEmailMutation() {
34
- const user = useUserIdentity();
35
- const [request, { loading: loading, data, errors }] = useMutation(VerificationEmailMutation);
36
- const sendVerificationEmailMutation = async () => {
37
- try {
38
- const result = await request({
39
- user: {
40
- id: user.id,
41
- accountId: user.accountId,
42
- },
43
- });
44
- if (result instanceof Error || !result)
45
- throw new Error();
46
- return result;
47
- }
48
- catch (e) {
49
- console.error("Could not send verification email", e);
50
- return undefined;
51
- }
52
- };
53
- return [
54
- sendVerificationEmailMutation,
55
- {
56
- loading,
57
- data,
58
- errors,
59
- },
60
- ];
61
- }
62
32
  export function useUpsertUserEmail() {
63
33
  const user = useUserIdentity();
64
34
  const [request, { loading: loading, data, errors }] = useMutation(UpsertUserEmailMutation);
65
35
  const upsertUserEmail = async (email) => {
66
36
  try {
67
37
  const result = await request({
68
- user: {
38
+ userInput: {
69
39
  id: user.id,
70
40
  accountId: user.accountId,
71
41
  email,
@@ -95,9 +65,9 @@ export function useWidgetEmailVerification(props) {
95
65
  const [emailExists, setEmailExists] = useState(false);
96
66
  const [error, setError] = useState(false);
97
67
  const [mutationError, setMutationError] = useState(false);
98
- const [sendVerificationEmailMutation] = useVerificationEmailMutation();
68
+ const { initialized, send: [sendEmail, { loading: sendLoading, errors }], } = useVerificationEmail();
99
69
  const [upsertUserEmail] = useUpsertUserEmail();
100
- const [loading, setLoading] = useState(false);
70
+ const [loading, setLoading] = useState(true);
101
71
  const { data, loading: initialLoading } = useQuery(UserLookupQuery, {});
102
72
  const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
103
73
  useEffect(() => {
@@ -105,6 +75,10 @@ export function useWidgetEmailVerification(props) {
105
75
  return;
106
76
  setEmailExists(!!data.viewer.email);
107
77
  }, [data]);
78
+ useEffect(() => {
79
+ if (initialized)
80
+ setLoading(false);
81
+ }, [initialized]);
108
82
  const submitEmail = async (e) => {
109
83
  e.preventDefault();
110
84
  if (!(data === null || data === void 0 ? void 0 : data.viewer))
@@ -123,8 +97,11 @@ export function useWidgetEmailVerification(props) {
123
97
  if (!result || !result.user.email)
124
98
  setError(true);
125
99
  }
126
- const result = await sendVerificationEmailMutation();
127
- if (!result || !result.requestUserEmailVerification.success)
100
+ // UI should not allow this call til initialisation is done
101
+ if (!initialized)
102
+ return;
103
+ const result = await sendEmail();
104
+ if (!result || !result.success)
128
105
  setMutationError(true);
129
106
  else {
130
107
  // This is used to let the code verification widget know an email was already sent
@@ -139,7 +116,7 @@ export function useWidgetEmailVerification(props) {
139
116
  },
140
117
  states: {
141
118
  loading,
142
- initialLoading,
119
+ initialLoading: initialLoading && !initialized,
143
120
  error,
144
121
  email: data === null || data === void 0 ? void 0 : data.viewer.email,
145
122
  sendCodeError: mutationError,
@@ -0,0 +1,120 @@
1
+ import { useParentState } from "@saasquatch/component-boilerplate";
2
+ import { withHooks } from "@saasquatch/stencil-hooks";
3
+ import { useCallback, useEffect, useState } from "@saasquatch/universal-hooks";
4
+ import { Component, h, Host } from "@stencil/core";
5
+ import debugFn from "debug";
6
+ import { VERIFICATION_PARENT_NAMESPACE } from "./keys";
7
+ const debug = debugFn("sq:widget-verification");
8
+ function useTemplateChildren({ parent, callback }) {
9
+ const parentObserver = new MutationObserver(listenForTemplateChanges);
10
+ const childTemplateObserver = new MutationObserver(callback);
11
+ parentObserver.observe(parent, {
12
+ childList: true,
13
+ // We only care about immediate children templates
14
+ subtree: false,
15
+ });
16
+ listenForTemplateChanges({ addedNodes: parent.querySelectorAll("template") });
17
+ function listenForTemplateChanges(mutationList) {
18
+ var _a;
19
+ // Be smart, only look at the mutation list
20
+ (_a = mutationList.addedNodes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
21
+ childTemplateObserver.observe(t.content, {
22
+ childList: true,
23
+ attributes: true,
24
+ // Look deep into the templates for re-rendering
25
+ subtree: true,
26
+ });
27
+ });
28
+ }
29
+ return () => {
30
+ parentObserver.disconnect();
31
+ childTemplateObserver.disconnect();
32
+ };
33
+ }
34
+ /**
35
+ * @uiName Widget Verification Controller
36
+ * @slots [{"name":"not-verified","title":"Not Verified template"},{"name":"verified","title":"Verified template"}]
37
+ * @canvasRenderer always-replace
38
+ * @exampleGroup Widget Verification
39
+ * @example Widget Verification Controller - <sqm-widget-verification-controller><template slot="not-verified"><sqm-widget-verification></sqm-widget-verification></template><template slot="verified"><sqm-tax-and-cash></sqm-tax-and-cash></template></sqm-widget-verification-controller>
40
+ */
41
+ export class WidgetVerificationController {
42
+ constructor() {
43
+ withHooks(this);
44
+ }
45
+ disconnectedCallback() { }
46
+ render() {
47
+ const [context, setContext] = useParentState({
48
+ namespace: VERIFICATION_PARENT_NAMESPACE,
49
+ initialValue: false,
50
+ });
51
+ const [container, setContainer] = useState(undefined);
52
+ const [slot, setSlot] = useState(undefined);
53
+ const updateTemplates = useCallback(() => {
54
+ const isAuth = context;
55
+ const templates = slot.querySelectorAll(`template`);
56
+ const template = Array.from(templates).find((t) => t.slot === (isAuth ? "verified" : "not-verified"));
57
+ if (template) {
58
+ // use outerHTML if template's innerHTML is unset (only happens in Stencilbook)
59
+ const newContent = template.innerHTML || template.firstElementChild.outerHTML;
60
+ // if template contents are an exact match
61
+ if (newContent === container.innerHTML) {
62
+ debug("don't rerender");
63
+ }
64
+ else if (template) {
65
+ container.innerHTML = newContent;
66
+ }
67
+ }
68
+ const plopTargets = Array.from(slot.children).filter((el) => el.tagName === "RAISINS-PLOP-TARGET");
69
+ // if editing in raisins
70
+ if (plopTargets.length) {
71
+ const loggedInPlopTargets = plopTargets.filter((el) => el.slot === "verified");
72
+ const loggedOutPlopTargets = plopTargets.filter((el) => el.slot === "not-verified");
73
+ loggedOutPlopTargets.forEach((target, i) => {
74
+ if (isAuth) {
75
+ target.style.display = "none";
76
+ return;
77
+ }
78
+ // Place last plop target at the bottom of the parent
79
+ if (i === loggedOutPlopTargets.length - 1) {
80
+ target.style.bottom = "0px";
81
+ target.style.left = "0px";
82
+ target.style.right = "0px";
83
+ target.style.position = "absolute";
84
+ }
85
+ target.style.height = "25px";
86
+ });
87
+ loggedInPlopTargets.forEach((target, i) => {
88
+ if (!isAuth) {
89
+ target.style.display = "none";
90
+ return;
91
+ }
92
+ // Place last plop target at the bottom of the parent
93
+ if (i === loggedInPlopTargets.length - 1) {
94
+ target.style.bottom = "0px";
95
+ target.style.left = "0px";
96
+ target.style.right = "0px";
97
+ target.style.position = "absolute";
98
+ }
99
+ target.style.height = "25px";
100
+ });
101
+ }
102
+ }, [container, slot, context]);
103
+ useEffect(() => {
104
+ if (!container || !slot) {
105
+ debug("DOM not ready:");
106
+ return;
107
+ }
108
+ // Run on first render
109
+ updateTemplates();
110
+ return useTemplateChildren({ parent: slot, callback: updateTemplates });
111
+ }, [slot, container, context]);
112
+ return (h(Host, null,
113
+ h("div", { ref: setSlot, style: { display: "contents" } },
114
+ h("slot", { name: "not-verified" }),
115
+ h("slot", { name: "verified" })),
116
+ h("div", { ref: setContainer },
117
+ h("slot", { name: "shown" }))));
118
+ }
119
+ static get is() { return "sqm-widget-verification-controller"; }
120
+ }