@saasquatch/mint-components 1.12.0-9 → 1.12.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 (187) hide show
  1. package/dist/cjs/{ShadowViewAddon-040cffad.js → ShadowViewAddon-88821c64.js} +3 -6
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +79 -202
  5. package/dist/cjs/sqm-big-stat_39.cjs.entry.js +160 -281
  6. package/dist/cjs/{sqm-invoice-table-view-c58966f8.js → sqm-invoice-table-view-a9133a11.js} +0 -98
  7. package/dist/cjs/sqm-portal-registration-form-view-621348a6.js +85 -0
  8. package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +12 -81
  9. package/dist/cjs/sqm-stencilbook.cjs.entry.js +323 -334
  10. package/dist/collection/collection-manifest.json +1 -6
  11. package/dist/collection/components/sqm-big-stat/useBigStat.js +3 -6
  12. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +5 -5
  13. package/dist/collection/components/sqm-marketing-emails-checkbox/MarketingEmailsCheckbox.stories.js +11 -0
  14. package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +160 -0
  15. package/dist/collection/components/sqm-portal-registration-form/PortalRegistrationForm.stories.js +5 -1
  16. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js +1 -1
  17. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form.js +3 -2
  18. package/dist/collection/components/sqm-portal-registration-form/usePortalRegistrationForm.js +6 -0
  19. package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -8
  20. package/dist/collection/components/tax-and-cash/BankingForm.stories.js +0 -2
  21. package/dist/collection/components/tax-and-cash/TaxForm.stories.js +0 -96
  22. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +1 -5
  23. package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +38 -101
  24. package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +2 -15
  25. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +0 -7
  26. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +8 -8
  27. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -2
  28. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +0 -22
  29. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +9 -99
  30. package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +1 -8
  31. package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +2 -2
  32. package/dist/collection/components/tax-and-cash/sqm-user-info-form/useUserInfoForm.js +11 -14
  33. package/dist/esm/{ShadowViewAddon-69b61037.js → ShadowViewAddon-65c8679e.js} +3 -6
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/esm/mint-components.js +1 -1
  36. package/dist/esm/sqm-banking-info-form_16.entry.js +79 -202
  37. package/dist/esm/sqm-big-stat_39.entry.js +159 -280
  38. package/dist/esm/{sqm-invoice-table-view-d1cfdaf4.js → sqm-invoice-table-view-71915a5e.js} +0 -98
  39. package/dist/esm/sqm-portal-registration-form-view-1d3066e1.js +83 -0
  40. package/dist/esm/sqm-portal-registration-form.entry.js +18 -87
  41. package/dist/esm/sqm-stencilbook.entry.js +323 -334
  42. package/dist/esm/stencil-hooks.module-ac12ca1c.js +1 -1
  43. package/dist/esm-es5/ShadowViewAddon-65c8679e.js +1 -0
  44. package/dist/esm-es5/loader.js +1 -1
  45. package/dist/esm-es5/mint-components.js +1 -1
  46. package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
  47. package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -1
  48. package/dist/esm-es5/sqm-invoice-table-view-71915a5e.js +1 -0
  49. package/dist/esm-es5/sqm-portal-registration-form-view-1d3066e1.js +1 -0
  50. package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
  51. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  52. package/dist/esm-es5/stencil-hooks.module-ac12ca1c.js +1 -1
  53. package/dist/mint-components/mint-components.esm.js +1 -1
  54. package/dist/mint-components/p-1279f7a3.system.entry.js +1 -0
  55. package/dist/mint-components/p-15a64357.entry.js +13 -0
  56. package/dist/mint-components/p-17f56865.entry.js +9 -0
  57. package/dist/mint-components/p-2a414b2e.system.js +2 -2
  58. package/dist/mint-components/p-3cb18382.system.js +1 -0
  59. package/dist/mint-components/p-40b1de58.js +1 -0
  60. package/dist/mint-components/p-4112e198.system.js +1 -0
  61. package/dist/mint-components/p-5cd917db.js +1 -0
  62. package/dist/mint-components/p-6792c8d8.system.entry.js +1 -0
  63. package/dist/mint-components/p-a02afa72.system.js +1 -0
  64. package/dist/mint-components/p-acd77a6e.entry.js +223 -0
  65. package/dist/mint-components/p-b3e97f8a.system.entry.js +1 -0
  66. package/dist/mint-components/{p-9eae245f.js → p-b651706a.js} +3 -6
  67. package/dist/mint-components/p-b8233366.entry.js +174 -0
  68. package/dist/mint-components/p-ca809fdd.system.js +1 -1
  69. package/dist/mint-components/p-cb38b9b0.system.entry.js +1 -0
  70. package/dist/mint-components/p-fd2c5407.js +2 -2
  71. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field-view.d.ts +1 -1
  72. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +4 -4
  73. package/dist/types/components/sqm-marketing-emails-checkbox/MarketingEmailsCheckbox.stories.d.ts +8 -0
  74. package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +34 -0
  75. package/dist/types/components/sqm-portal-registration-form/PortalRegistrationForm.stories.d.ts +1 -0
  76. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form-view.d.ts +1 -0
  77. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form.d.ts +1 -1
  78. package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +0 -2
  79. package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +0 -2
  80. package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +1 -1
  81. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/data.d.ts +0 -6
  82. package/dist/types/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.d.ts +2 -2
  83. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +0 -12
  84. package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +2 -19
  85. package/dist/types/components.d.ts +108 -625
  86. package/docs/docs.docx +0 -0
  87. package/docs/raisins.json +1 -1
  88. package/grapesjs/grapesjs.js +1 -1
  89. package/package.json +2 -2
  90. package/dist/cjs/extractProps-fd93ba62.js +0 -21
  91. package/dist/cjs/keys-cff24974.js +0 -11
  92. package/dist/cjs/sqm-code-verification.cjs.entry.js +0 -342
  93. package/dist/cjs/sqm-email-verification.cjs.entry.js +0 -283
  94. package/dist/cjs/sqm-scroll.cjs.entry.js +0 -109
  95. package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +0 -103
  96. package/dist/cjs/sqm-widget-verification.cjs.entry.js +0 -210
  97. package/dist/cjs/usePayoutStatus-b9fb7399.js +0 -70
  98. package/dist/cjs/useVerificationEmail-6aacdb71.js +0 -169
  99. package/dist/collection/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.js +0 -8
  100. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.js +0 -23
  101. package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +0 -118
  102. package/dist/collection/components/sqm-payout-button-scroll/usePayoutButton.js +0 -44
  103. package/dist/collection/components/sqm-widget-verification/keys.js +0 -4
  104. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.js +0 -36
  105. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +0 -128
  106. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +0 -301
  107. package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +0 -153
  108. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.js +0 -42
  109. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +0 -91
  110. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.js +0 -226
  111. package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +0 -126
  112. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +0 -339
  113. package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +0 -557
  114. package/dist/collection/components/sqm-widget-verification/useVerificationEmail.js +0 -165
  115. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +0 -22
  116. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +0 -131
  117. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +0 -354
  118. package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +0 -65
  119. package/dist/esm/extractProps-ae1afbb3.js +0 -19
  120. package/dist/esm/keys-db1897ae.js +0 -6
  121. package/dist/esm/sqm-code-verification.entry.js +0 -338
  122. package/dist/esm/sqm-email-verification.entry.js +0 -279
  123. package/dist/esm/sqm-scroll.entry.js +0 -105
  124. package/dist/esm/sqm-widget-verification-internal.entry.js +0 -99
  125. package/dist/esm/sqm-widget-verification.entry.js +0 -206
  126. package/dist/esm/usePayoutStatus-1a635054.js +0 -67
  127. package/dist/esm/useVerificationEmail-c32696ba.js +0 -167
  128. package/dist/esm-es5/ShadowViewAddon-69b61037.js +0 -1
  129. package/dist/esm-es5/extractProps-ae1afbb3.js +0 -1
  130. package/dist/esm-es5/keys-db1897ae.js +0 -1
  131. package/dist/esm-es5/sqm-code-verification.entry.js +0 -1
  132. package/dist/esm-es5/sqm-email-verification.entry.js +0 -1
  133. package/dist/esm-es5/sqm-invoice-table-view-d1cfdaf4.js +0 -1
  134. package/dist/esm-es5/sqm-scroll.entry.js +0 -1
  135. package/dist/esm-es5/sqm-widget-verification-internal.entry.js +0 -1
  136. package/dist/esm-es5/sqm-widget-verification.entry.js +0 -1
  137. package/dist/esm-es5/usePayoutStatus-1a635054.js +0 -1
  138. package/dist/esm-es5/useVerificationEmail-c32696ba.js +0 -1
  139. package/dist/mint-components/p-1712a9fd.entry.js +0 -11
  140. package/dist/mint-components/p-1e616d45.system.js +0 -1
  141. package/dist/mint-components/p-24092973.entry.js +0 -9
  142. package/dist/mint-components/p-26468242.js +0 -1
  143. package/dist/mint-components/p-331d060e.entry.js +0 -223
  144. package/dist/mint-components/p-3925bcd6.entry.js +0 -13
  145. package/dist/mint-components/p-39840341.js +0 -1
  146. package/dist/mint-components/p-4364001c.entry.js +0 -12
  147. package/dist/mint-components/p-4bd7a472.js +0 -1
  148. package/dist/mint-components/p-517224ef.js +0 -19
  149. package/dist/mint-components/p-5a23b560.system.entry.js +0 -1
  150. package/dist/mint-components/p-64491210.system.entry.js +0 -1
  151. package/dist/mint-components/p-8300d8c8.system.js +0 -1
  152. package/dist/mint-components/p-8bddb468.system.entry.js +0 -1
  153. package/dist/mint-components/p-9596e97c.system.entry.js +0 -1
  154. package/dist/mint-components/p-974070c4.system.entry.js +0 -1
  155. package/dist/mint-components/p-a85f57bb.entry.js +0 -1
  156. package/dist/mint-components/p-a8645c1b.system.js +0 -1
  157. package/dist/mint-components/p-b2a99637.system.js +0 -1
  158. package/dist/mint-components/p-b62faaa5.system.entry.js +0 -1
  159. package/dist/mint-components/p-c05e7b9f.entry.js +0 -195
  160. package/dist/mint-components/p-c510fb88.entry.js +0 -1
  161. package/dist/mint-components/p-c7057066.system.entry.js +0 -1
  162. package/dist/mint-components/p-d7806f31.js +0 -48
  163. package/dist/mint-components/p-e01ac27c.system.js +0 -1
  164. package/dist/mint-components/p-e45a8501.system.entry.js +0 -1
  165. package/dist/mint-components/p-e990dc21.system.js +0 -1
  166. package/dist/mint-components/p-ead27698.system.entry.js +0 -1
  167. package/dist/mint-components/p-f340214f.entry.js +0 -25
  168. package/dist/types/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.d.ts +0 -5
  169. package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.d.ts +0 -10
  170. package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll.d.ts +0 -26
  171. package/dist/types/components/sqm-payout-button-scroll/usePayoutButton.d.ts +0 -7
  172. package/dist/types/components/sqm-widget-verification/keys.d.ts +0 -4
  173. package/dist/types/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.d.ts +0 -9
  174. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.d.ts +0 -26
  175. package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +0 -54
  176. package/dist/types/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.d.ts +0 -25
  177. package/dist/types/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.d.ts +0 -10
  178. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.d.ts +0 -21
  179. package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.d.ts +0 -40
  180. package/dist/types/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.d.ts +0 -10
  181. package/dist/types/components/sqm-widget-verification/sqm-widget-verification-internal.d.ts +0 -20
  182. package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +0 -87
  183. package/dist/types/components/sqm-widget-verification/useVerificationEmail.d.ts +0 -14
  184. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +0 -10
  185. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +0 -30
  186. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +0 -62
  187. package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +0 -21
@@ -1,557 +0,0 @@
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, Prop } from "@stencil/core";
5
- import debugFn from "debug";
6
- import { VERIFICATION_PARENT_NAMESPACE } from "./keys";
7
- import { getProps } from "../../utils/utils";
8
- const debug = debugFn("sq:widget-verification");
9
- function useTemplateChildren({ parent, callback }) {
10
- const parentObserver = new MutationObserver(listenForTemplateChanges);
11
- const childTemplateObserver = new MutationObserver(callback);
12
- parentObserver.observe(parent, {
13
- childList: true,
14
- // We only care about immediate children templates
15
- subtree: false,
16
- });
17
- listenForTemplateChanges({ addedNodes: parent.querySelectorAll("template") });
18
- function listenForTemplateChanges(mutationList) {
19
- var _a;
20
- // Be smart, only look at the mutation list
21
- (_a = mutationList.addedNodes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
22
- childTemplateObserver.observe(t.content, {
23
- childList: true,
24
- attributes: true,
25
- // Look deep into the templates for re-rendering
26
- subtree: true,
27
- });
28
- });
29
- }
30
- return () => {
31
- parentObserver.disconnect();
32
- childTemplateObserver.disconnect();
33
- };
34
- }
35
- /**
36
- * @uiName Widget Verification Gate
37
- * @slots [{"name":"not-verified","title":"Not verified template"},{"name":"verified","title":"Verified template"}]
38
- * @canvasRenderer always-replace
39
- * @exampleGroup Widget Verification
40
- * @example Widget Verification Gate - <sqm-widget-verification><template slot="verified"><sqm-tax-and-cash></sqm-tax-and-cash></template></sqm-widget-verification>
41
- */
42
- export class WidgetVerification {
43
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
- CODE STEP PROPS
45
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
46
- constructor() {
47
- // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
48
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49
- EMAIL STEP PROPS
50
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
51
- /**
52
- * @uiName Verify email widget header text
53
- * @uiGroup Email Verification Step
54
- */
55
- this.emailStep_verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
56
- /**
57
- * @uiName Send code to email alert header
58
- * @uiGroup Email Verification Step
59
- */
60
- this.emailStep_sendCodeErrorHeader = "There was an error sending your code.";
61
- /**
62
- * @uiName Send code to email alert description
63
- * @uiGroup Email Verification Step
64
- */
65
- this.emailStep_sendCodeErrorDescription = "Please try again. If this problem continues, contact our program support team.";
66
- /**
67
- * @uiName Email input label
68
- * @uiGroup Email Verification Step
69
- */
70
- this.emailStep_emailLabel = "Email";
71
- /**
72
- * @uiName Send code button text
73
- * @uiGroup Email Verification Step
74
- */
75
- this.emailStep_sendCodeText = "Send code";
76
- /**
77
- * @uiName Send code button text
78
- * @uiGroup Email Verification Step
79
- */
80
- this.emailStep_emailValidationErrorText = "Please enter a valid email";
81
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82
- EMAIL STEP PROPS
83
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
84
- /**
85
- * @uiName Verify code widget header text
86
- * @uiGroup Code Verification Step
87
- */
88
- this.codeStep_verifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
89
- /**
90
- * @uiName Reverify code widget header text
91
- * @uiGroup Code Verification Step
92
- */
93
- this.codeStep_reverifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
94
- /**
95
- * Text displayed under verify button
96
- * @uiName Resend code text
97
- * @uiGroup Code Verification Step
98
- */
99
- this.codeStep_resendCodeText = "Didn't receive your code? {resendCodeLink}";
100
- /**
101
- * The link that appears in the resend code link
102
- * @uiName Resend code label
103
- * @uiGroup Code Verification Step
104
- */
105
- this.codeStep_resendCodeLabel = "Resend code";
106
- /**
107
- * Link text displayed under verify button
108
- * @uiName Resend code text
109
- * @uiGroup Code Verification Step
110
- */
111
- this.codeStep_codeResentSuccessfullyText = "Another code has been sent to {email}";
112
- /**
113
- * Error text displayed under verification input
114
- * @uiName Invalid code text
115
- * @uiGroup Code Verification Step
116
- */
117
- this.codeStep_invalidCodeText = "Please check your code and try again. If you’re still having trouble, try resending your code.";
118
- /**
119
- * @uiName Verify code button text
120
- * @uiGroup Code Verification Step
121
- */
122
- this.codeStep_verifyText = "Verify";
123
- /**
124
- * Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
125
- * @uiName Network error message
126
- * @uiGroup Code Verification Step
127
- */
128
- this.codeStep_networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
129
- withHooks(this);
130
- }
131
- disconnectedCallback() { }
132
- render() {
133
- const [context, setContext] = useParentState({
134
- namespace: VERIFICATION_PARENT_NAMESPACE,
135
- initialValue: false,
136
- });
137
- const [container, setContainer] = useState(undefined);
138
- const [slot, setSlot] = useState(undefined);
139
- const updateTemplates = useCallback(() => {
140
- const isAuth = context;
141
- const templates = slot.querySelectorAll(`template`);
142
- const template = Array.from(templates).find((t) => t.slot === (isAuth ? "verified" : "not-verified"));
143
- if (template) {
144
- // use outerHTML if template's innerHTML is unset (only happens in Stencilbook)
145
- const newContent = template.innerHTML || template.firstElementChild.outerHTML;
146
- // if template contents are an exact match
147
- if (newContent === container.innerHTML) {
148
- debug("don't rerender");
149
- }
150
- else if (template) {
151
- container.innerHTML = newContent;
152
- }
153
- }
154
- const plopTargets = Array.from(slot.children).filter((el) => el.tagName === "RAISINS-PLOP-TARGET");
155
- // if editing in raisins
156
- if (plopTargets.length) {
157
- const loggedInPlopTargets = plopTargets.filter((el) => el.slot === "verified");
158
- const loggedOutPlopTargets = plopTargets.filter((el) => el.slot === "not-verified");
159
- loggedOutPlopTargets.forEach((target, i) => {
160
- if (isAuth) {
161
- target.style.display = "none";
162
- return;
163
- }
164
- // Place last plop target at the bottom of the parent
165
- if (i === loggedOutPlopTargets.length - 1) {
166
- target.style.bottom = "0px";
167
- target.style.left = "0px";
168
- target.style.right = "0px";
169
- target.style.position = "absolute";
170
- }
171
- target.style.height = "25px";
172
- });
173
- loggedInPlopTargets.forEach((target, i) => {
174
- if (!isAuth) {
175
- target.style.display = "none";
176
- return;
177
- }
178
- // Place last plop target at the bottom of the parent
179
- if (i === loggedInPlopTargets.length - 1) {
180
- target.style.bottom = "0px";
181
- target.style.left = "0px";
182
- target.style.right = "0px";
183
- target.style.position = "absolute";
184
- }
185
- target.style.height = "25px";
186
- });
187
- }
188
- }, [container, slot, context]);
189
- useEffect(() => {
190
- if (!container || !slot) {
191
- debug("DOM not ready:");
192
- return;
193
- }
194
- // Run on first render
195
- updateTemplates();
196
- return useTemplateChildren({ parent: slot, callback: updateTemplates });
197
- }, [slot, container, context]);
198
- // useEffect(() => {
199
- // const host = useHost();
200
- // const callback = (e: CustomEvent) => {
201
- // e.stopPropagation();
202
- // setContext({ token: e.detail.token });
203
- // };
204
- // host.addEventListener(VERIFICATION_EVENT_KEY, callback);
205
- // return () => {
206
- // host.removeEventListener(VERIFICATION_EVENT_KEY, callback);
207
- // };
208
- // }, []);
209
- return (h(Host, null,
210
- h("div", { ref: setSlot, style: { display: "contents" } },
211
- h("template", { slot: "not-verified" },
212
- h("sqm-widget-verification-internal", Object.assign({}, getProps(this)))),
213
- h("slot", { name: "not-verified" }),
214
- h("slot", { name: "verified" })),
215
- h("div", { ref: setContainer },
216
- h("slot", { name: "shown" }))));
217
- }
218
- static get is() { return "sqm-widget-verification"; }
219
- static get properties() { return {
220
- "emailStep_verifyEmailHeaderText": {
221
- "type": "string",
222
- "mutable": false,
223
- "complexType": {
224
- "original": "string",
225
- "resolved": "string",
226
- "references": {}
227
- },
228
- "required": false,
229
- "optional": false,
230
- "docs": {
231
- "tags": [{
232
- "text": "Verify email widget header text",
233
- "name": "uiName"
234
- }, {
235
- "text": "Email Verification Step",
236
- "name": "uiGroup"
237
- }],
238
- "text": ""
239
- },
240
- "attribute": "email-step_verify-email-header-text",
241
- "reflect": false,
242
- "defaultValue": "\"Start by verifying your email. We\u2019ll send you a code through our referral provider, impact.com.\""
243
- },
244
- "emailStep_sendCodeErrorHeader": {
245
- "type": "string",
246
- "mutable": false,
247
- "complexType": {
248
- "original": "string",
249
- "resolved": "string",
250
- "references": {}
251
- },
252
- "required": false,
253
- "optional": false,
254
- "docs": {
255
- "tags": [{
256
- "text": "Send code to email alert header",
257
- "name": "uiName"
258
- }, {
259
- "text": "Email Verification Step",
260
- "name": "uiGroup"
261
- }],
262
- "text": ""
263
- },
264
- "attribute": "email-step_send-code-error-header",
265
- "reflect": false,
266
- "defaultValue": "\"There was an error sending your code.\""
267
- },
268
- "emailStep_sendCodeErrorDescription": {
269
- "type": "string",
270
- "mutable": false,
271
- "complexType": {
272
- "original": "string",
273
- "resolved": "string",
274
- "references": {}
275
- },
276
- "required": false,
277
- "optional": false,
278
- "docs": {
279
- "tags": [{
280
- "text": "Send code to email alert description",
281
- "name": "uiName"
282
- }, {
283
- "text": "Email Verification Step",
284
- "name": "uiGroup"
285
- }],
286
- "text": ""
287
- },
288
- "attribute": "email-step_send-code-error-description",
289
- "reflect": false,
290
- "defaultValue": "\"Please try again. If this problem continues, contact our program support team.\""
291
- },
292
- "emailStep_emailLabel": {
293
- "type": "string",
294
- "mutable": false,
295
- "complexType": {
296
- "original": "string",
297
- "resolved": "string",
298
- "references": {}
299
- },
300
- "required": false,
301
- "optional": false,
302
- "docs": {
303
- "tags": [{
304
- "text": "Email input label",
305
- "name": "uiName"
306
- }, {
307
- "text": "Email Verification Step",
308
- "name": "uiGroup"
309
- }],
310
- "text": ""
311
- },
312
- "attribute": "email-step_email-label",
313
- "reflect": false,
314
- "defaultValue": "\"Email\""
315
- },
316
- "emailStep_sendCodeText": {
317
- "type": "string",
318
- "mutable": false,
319
- "complexType": {
320
- "original": "string",
321
- "resolved": "string",
322
- "references": {}
323
- },
324
- "required": false,
325
- "optional": false,
326
- "docs": {
327
- "tags": [{
328
- "text": "Send code button text",
329
- "name": "uiName"
330
- }, {
331
- "text": "Email Verification Step",
332
- "name": "uiGroup"
333
- }],
334
- "text": ""
335
- },
336
- "attribute": "email-step_send-code-text",
337
- "reflect": false,
338
- "defaultValue": "\"Send code\""
339
- },
340
- "emailStep_emailValidationErrorText": {
341
- "type": "string",
342
- "mutable": false,
343
- "complexType": {
344
- "original": "string",
345
- "resolved": "string",
346
- "references": {}
347
- },
348
- "required": false,
349
- "optional": false,
350
- "docs": {
351
- "tags": [{
352
- "text": "Send code button text",
353
- "name": "uiName"
354
- }, {
355
- "text": "Email Verification Step",
356
- "name": "uiGroup"
357
- }],
358
- "text": ""
359
- },
360
- "attribute": "email-step_email-validation-error-text",
361
- "reflect": false,
362
- "defaultValue": "\"Please enter a valid email\""
363
- },
364
- "codeStep_verifyCodeHeaderText": {
365
- "type": "string",
366
- "mutable": false,
367
- "complexType": {
368
- "original": "string",
369
- "resolved": "string",
370
- "references": {}
371
- },
372
- "required": false,
373
- "optional": false,
374
- "docs": {
375
- "tags": [{
376
- "text": "Verify code widget header text",
377
- "name": "uiName"
378
- }, {
379
- "text": "Code Verification Step",
380
- "name": "uiGroup"
381
- }],
382
- "text": ""
383
- },
384
- "attribute": "code-step_verify-code-header-text",
385
- "reflect": false,
386
- "defaultValue": "\"Enter the code sent to {email} from our referral provider, impact.com.\""
387
- },
388
- "codeStep_reverifyCodeHeaderText": {
389
- "type": "string",
390
- "mutable": false,
391
- "complexType": {
392
- "original": "string",
393
- "resolved": "string",
394
- "references": {}
395
- },
396
- "required": false,
397
- "optional": false,
398
- "docs": {
399
- "tags": [{
400
- "text": "Reverify code widget header text",
401
- "name": "uiName"
402
- }, {
403
- "text": "Code Verification Step",
404
- "name": "uiGroup"
405
- }],
406
- "text": ""
407
- },
408
- "attribute": "code-step_reverify-code-header-text",
409
- "reflect": false,
410
- "defaultValue": "\"Enter the code sent to {email} from our referral provider, impact.com.\""
411
- },
412
- "codeStep_resendCodeText": {
413
- "type": "string",
414
- "mutable": false,
415
- "complexType": {
416
- "original": "string",
417
- "resolved": "string",
418
- "references": {}
419
- },
420
- "required": false,
421
- "optional": false,
422
- "docs": {
423
- "tags": [{
424
- "text": "Resend code text",
425
- "name": "uiName"
426
- }, {
427
- "text": "Code Verification Step",
428
- "name": "uiGroup"
429
- }],
430
- "text": "Text displayed under verify button"
431
- },
432
- "attribute": "code-step_resend-code-text",
433
- "reflect": false,
434
- "defaultValue": "\"Didn't receive your code? {resendCodeLink}\""
435
- },
436
- "codeStep_resendCodeLabel": {
437
- "type": "string",
438
- "mutable": false,
439
- "complexType": {
440
- "original": "string",
441
- "resolved": "string",
442
- "references": {}
443
- },
444
- "required": false,
445
- "optional": false,
446
- "docs": {
447
- "tags": [{
448
- "text": "Resend code label",
449
- "name": "uiName"
450
- }, {
451
- "text": "Code Verification Step",
452
- "name": "uiGroup"
453
- }],
454
- "text": "The link that appears in the resend code link"
455
- },
456
- "attribute": "code-step_resend-code-label",
457
- "reflect": false,
458
- "defaultValue": "\"Resend code\""
459
- },
460
- "codeStep_codeResentSuccessfullyText": {
461
- "type": "string",
462
- "mutable": false,
463
- "complexType": {
464
- "original": "string",
465
- "resolved": "string",
466
- "references": {}
467
- },
468
- "required": false,
469
- "optional": false,
470
- "docs": {
471
- "tags": [{
472
- "text": "Resend code text",
473
- "name": "uiName"
474
- }, {
475
- "text": "Code Verification Step",
476
- "name": "uiGroup"
477
- }],
478
- "text": "Link text displayed under verify button"
479
- },
480
- "attribute": "code-step_code-resent-successfully-text",
481
- "reflect": false,
482
- "defaultValue": "\"Another code has been sent to {email}\""
483
- },
484
- "codeStep_invalidCodeText": {
485
- "type": "string",
486
- "mutable": false,
487
- "complexType": {
488
- "original": "string",
489
- "resolved": "string",
490
- "references": {}
491
- },
492
- "required": false,
493
- "optional": false,
494
- "docs": {
495
- "tags": [{
496
- "text": "Invalid code text",
497
- "name": "uiName"
498
- }, {
499
- "text": "Code Verification Step",
500
- "name": "uiGroup"
501
- }],
502
- "text": "Error text displayed under verification input"
503
- },
504
- "attribute": "code-step_invalid-code-text",
505
- "reflect": false,
506
- "defaultValue": "\"Please check your code and try again. If you\u2019re still having trouble, try resending your code.\""
507
- },
508
- "codeStep_verifyText": {
509
- "type": "string",
510
- "mutable": false,
511
- "complexType": {
512
- "original": "string",
513
- "resolved": "string",
514
- "references": {}
515
- },
516
- "required": false,
517
- "optional": false,
518
- "docs": {
519
- "tags": [{
520
- "text": "Verify code button text",
521
- "name": "uiName"
522
- }, {
523
- "text": "Code Verification Step",
524
- "name": "uiGroup"
525
- }],
526
- "text": ""
527
- },
528
- "attribute": "code-step_verify-text",
529
- "reflect": false,
530
- "defaultValue": "\"Verify\""
531
- },
532
- "codeStep_networkErrorMessage": {
533
- "type": "string",
534
- "mutable": false,
535
- "complexType": {
536
- "original": "string",
537
- "resolved": "string",
538
- "references": {}
539
- },
540
- "required": false,
541
- "optional": false,
542
- "docs": {
543
- "tags": [{
544
- "text": "Network error message",
545
- "name": "uiName"
546
- }, {
547
- "text": "Code Verification Step",
548
- "name": "uiGroup"
549
- }],
550
- "text": "Displayed when the email verification fails due to a network error. The participant can try refreshing the page."
551
- },
552
- "attribute": "code-step_network-error-message",
553
- "reflect": false,
554
- "defaultValue": "\"An error occurred while verifying your email. Please refresh the page and try again.\""
555
- }
556
- }; }
557
- }