@saasquatch/mint-components 1.8.0-84 → 1.8.0-86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +8 -3
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
- package/dist/collection/components/sqm-portal-verify-email/usePortalVerifyEmail.js +11 -5
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +3 -3
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/defaultTextCopy.js +1 -1
- package/dist/esm/sqm-portal-verify-email.entry.js +10 -5
- package/dist/esm/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-d78221ad.entry.js → p-222e9cea.entry.js} +1 -1
- package/dist/mint-components/p-785c2c05.system.entry.js +1 -0
- package/dist/mint-components/p-bedd0a2c.entry.js +1 -0
- package/dist/mint-components/{p-930895ab.system.entry.js → p-c4771341.system.entry.js} +1 -1
- package/dist/mint-components/p-d5364cae.system.js +1 -1
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/mint-components/p-65e3255f.entry.js +0 -1
- package/dist/mint-components/p-89b4e116.system.entry.js +0 -1
|
@@ -12,9 +12,11 @@ const utils = require('./utils-6847bc06.js');
|
|
|
12
12
|
require('./sqm-text-span-view-2e945b0c.js');
|
|
13
13
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-1e6255e9.js');
|
|
14
14
|
|
|
15
|
+
const SUBMITTED_CONTEXT = "sq:verify-submitted";
|
|
15
16
|
function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyEmailText, verifyInvalidText, networkErrorMessage, continueText, }) {
|
|
16
17
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
17
|
-
const [submitted, setSubmitted] = stencilHooks_module.
|
|
18
|
+
const [submitted, setSubmitted] = stencilHooks_module.m(SUBMITTED_CONTEXT, false);
|
|
19
|
+
const locale = index_module.N();
|
|
18
20
|
const userIdent = index_module.H();
|
|
19
21
|
const [request, { loading, data, errors }] = index_module.nn();
|
|
20
22
|
const urlParams = new URLSearchParams(index_module.yn.location.search);
|
|
@@ -38,6 +40,7 @@ function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyE
|
|
|
38
40
|
const submit = async () => {
|
|
39
41
|
var _a;
|
|
40
42
|
setSubmitted(true);
|
|
43
|
+
console.log("submit", { submitted });
|
|
41
44
|
if (oobCode) {
|
|
42
45
|
const result = await request({ oobCode });
|
|
43
46
|
if ((result instanceof Error ||
|
|
@@ -52,15 +55,17 @@ function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyE
|
|
|
52
55
|
}
|
|
53
56
|
};
|
|
54
57
|
stencilHooks_module.useEffect(() => {
|
|
58
|
+
console.log({ submitted, locale });
|
|
55
59
|
// Already verified, begin redirect
|
|
56
60
|
if (verified) {
|
|
57
61
|
setTimeout(() => {
|
|
58
62
|
gotoNextPage();
|
|
59
63
|
}, 3000);
|
|
64
|
+
return;
|
|
60
65
|
}
|
|
61
|
-
if (userIdent && !data && !submitted &&
|
|
66
|
+
if (userIdent && !data && !submitted && locale !== undefined)
|
|
62
67
|
submit();
|
|
63
|
-
}, [verified, submitted, data, userIdent]);
|
|
68
|
+
}, [verified, submitted, data, userIdent, submitted, locale]);
|
|
64
69
|
return {
|
|
65
70
|
states: {
|
|
66
71
|
loading: loading || disableContinue,
|
|
@@ -13937,7 +13937,7 @@ const indirectDetailsSlotText = {
|
|
|
13937
13937
|
isRegisteredSubRegionIncomeTax: "I am an individual registered for Income Tax purposes in Spain, and withholding tax will apply to any payments made to me.",
|
|
13938
13938
|
qstNumber: "QST Number",
|
|
13939
13939
|
subRegion: "Sub-region",
|
|
13940
|
-
subRegionTaxNumberLabel: "Income
|
|
13940
|
+
subRegionTaxNumberLabel: "Income tax number",
|
|
13941
13941
|
error: {
|
|
13942
13942
|
indirectTaxNumber: "Indirect Tax is required",
|
|
13943
13943
|
fieldRequiredError: "{fieldName} is required",
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { navigation, useUserIdentity, useVerifyEmailMutation, } from "@saasquatch/component-boilerplate";
|
|
2
|
-
import {
|
|
1
|
+
import { navigation, useLocale, useUserIdentity, useVerifyEmailMutation, } from "@saasquatch/component-boilerplate";
|
|
2
|
+
import { useDomContextState } from "@saasquatch/stencil-hooks";
|
|
3
|
+
import { useEffect } from "@saasquatch/universal-hooks";
|
|
3
4
|
import { sanitizeUrlPath } from "../../utils/utils";
|
|
5
|
+
const SUBMITTED_CONTEXT = "sq:verify-submitted";
|
|
4
6
|
export function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyEmailText, verifyInvalidText, networkErrorMessage, continueText, }) {
|
|
5
7
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6
|
-
const [submitted, setSubmitted] =
|
|
8
|
+
const [submitted, setSubmitted] = useDomContextState(SUBMITTED_CONTEXT, false);
|
|
9
|
+
const locale = useLocale();
|
|
7
10
|
const userIdent = useUserIdentity();
|
|
8
11
|
const [request, { loading, data, errors }] = useVerifyEmailMutation();
|
|
9
12
|
const urlParams = new URLSearchParams(navigation.location.search);
|
|
@@ -27,6 +30,7 @@ export function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText,
|
|
|
27
30
|
const submit = async () => {
|
|
28
31
|
var _a;
|
|
29
32
|
setSubmitted(true);
|
|
33
|
+
console.log("submit", { submitted });
|
|
30
34
|
if (oobCode) {
|
|
31
35
|
const result = await request({ oobCode });
|
|
32
36
|
if ((result instanceof Error ||
|
|
@@ -41,15 +45,17 @@ export function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText,
|
|
|
41
45
|
}
|
|
42
46
|
};
|
|
43
47
|
useEffect(() => {
|
|
48
|
+
console.log({ submitted, locale });
|
|
44
49
|
// Already verified, begin redirect
|
|
45
50
|
if (verified) {
|
|
46
51
|
setTimeout(() => {
|
|
47
52
|
gotoNextPage();
|
|
48
53
|
}, 3000);
|
|
54
|
+
return;
|
|
49
55
|
}
|
|
50
|
-
if (userIdent && !data && !submitted &&
|
|
56
|
+
if (userIdent && !data && !submitted && locale !== undefined)
|
|
51
57
|
submit();
|
|
52
|
-
}, [verified, submitted, data, userIdent]);
|
|
58
|
+
}, [verified, submitted, data, userIdent, submitted, locale]);
|
|
53
59
|
return {
|
|
54
60
|
states: {
|
|
55
61
|
loading: loading || disableContinue,
|
|
@@ -27,8 +27,8 @@ export function useTaxAndCash() {
|
|
|
27
27
|
// const accountId =
|
|
28
28
|
// "4c794ebe367f7021e3ce543542e27389d76394571b1bb8e7ebfbbd33ae4214d1";
|
|
29
29
|
// andy3
|
|
30
|
-
const id = "
|
|
31
|
-
const accountId = "
|
|
30
|
+
const id = "e061ee21b45eff8ada22845d441c6a2cd7190af1718a55452ad2d44b020915a7";
|
|
31
|
+
const accountId = "e061ee21b45eff8ada22845d441c6a2cd7190af1718a55452ad2d44b020915a7";
|
|
32
32
|
// // andy
|
|
33
33
|
// const id = "12345";
|
|
34
34
|
// const accountId = "12345";
|
|
@@ -64,7 +64,7 @@ export function useTaxAndCash() {
|
|
|
64
64
|
setUserIdentity({
|
|
65
65
|
accountId,
|
|
66
66
|
id,
|
|
67
|
-
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklSTVhzWXk2WVlxcTQ2OTQzN21HOEVSUXQ4UW9LRkJhRzEifQ.
|
|
67
|
+
jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IklSTVhzWXk2WVlxcTQ2OTQzN21HOEVSUXQ4UW9LRkJhRzEifQ.eyJ1c2VyIjp7ImlkIjoiZTA2MWVlMjFiNDVlZmY4YWRhMjI4NDVkNDQxYzZhMmNkNzE5MGFmMTcxOGE1NTQ1MmFkMmQ0NGIwMjA5MTVhNyIsImFjY291bnRJZCI6ImUwNjFlZTIxYjQ1ZWZmOGFkYTIyODQ1ZDQ0MWM2YTJjZDcxOTBhZjE3MThhNTU0NTJhZDJkNDRiMDIwOTE1YTciLCJlbWFpbCI6InRlc3R1c2VyQGV4YW1wbGUuY29tIn19.92Dtz49tnl8ZL9oDAkNeND8SX5OSFlt5Y7FXP92sGiA",
|
|
68
68
|
});
|
|
69
69
|
}, []);
|
|
70
70
|
// andy
|
|
@@ -10,7 +10,7 @@ export const indirectDetailsSlotText = {
|
|
|
10
10
|
isRegisteredSubRegionIncomeTax: "I am an individual registered for Income Tax purposes in Spain, and withholding tax will apply to any payments made to me.",
|
|
11
11
|
qstNumber: "QST Number",
|
|
12
12
|
subRegion: "Sub-region",
|
|
13
|
-
subRegionTaxNumberLabel: "Income
|
|
13
|
+
subRegionTaxNumberLabel: "Income tax number",
|
|
14
14
|
error: {
|
|
15
15
|
indirectTaxNumber: "Indirect Tax is required",
|
|
16
16
|
fieldRequiredError: "{fieldName} is required",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h as h$1 } from './index-f16aa635.js';
|
|
2
|
-
import {
|
|
3
|
-
import { H, n as nn, y as yn, i as isDemo } from './index.module-a46df001.js';
|
|
2
|
+
import { o as m, f as useEffect, m as h } from './stencil-hooks.module-aa42e74f.js';
|
|
3
|
+
import { N, H, n as nn, y as yn, i as isDemo } from './index.module-a46df001.js';
|
|
4
4
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
5
5
|
import './mixins-f60a614c.js';
|
|
6
6
|
import './JSS-67b5cff8.js';
|
|
@@ -8,9 +8,11 @@ import { s as sanitizeUrlPath, g as getProps } from './utils-334c1e34.js';
|
|
|
8
8
|
import './sqm-text-span-view-d776bd9c.js';
|
|
9
9
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-fb6875bb.js';
|
|
10
10
|
|
|
11
|
+
const SUBMITTED_CONTEXT = "sq:verify-submitted";
|
|
11
12
|
function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyEmailText, verifyInvalidText, networkErrorMessage, continueText, }) {
|
|
12
13
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13
|
-
const [submitted, setSubmitted] =
|
|
14
|
+
const [submitted, setSubmitted] = m(SUBMITTED_CONTEXT, false);
|
|
15
|
+
const locale = N();
|
|
14
16
|
const userIdent = H();
|
|
15
17
|
const [request, { loading, data, errors }] = nn();
|
|
16
18
|
const urlParams = new URLSearchParams(yn.location.search);
|
|
@@ -34,6 +36,7 @@ function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyE
|
|
|
34
36
|
const submit = async () => {
|
|
35
37
|
var _a;
|
|
36
38
|
setSubmitted(true);
|
|
39
|
+
console.log("submit", { submitted });
|
|
37
40
|
if (oobCode) {
|
|
38
41
|
const result = await request({ oobCode });
|
|
39
42
|
if ((result instanceof Error ||
|
|
@@ -48,15 +51,17 @@ function usePortalVerifyEmail({ nextPage, failedPage, verifySuccessText, verifyE
|
|
|
48
51
|
}
|
|
49
52
|
};
|
|
50
53
|
useEffect(() => {
|
|
54
|
+
console.log({ submitted, locale });
|
|
51
55
|
// Already verified, begin redirect
|
|
52
56
|
if (verified) {
|
|
53
57
|
setTimeout(() => {
|
|
54
58
|
gotoNextPage();
|
|
55
59
|
}, 3000);
|
|
60
|
+
return;
|
|
56
61
|
}
|
|
57
|
-
if (userIdent && !data && !submitted &&
|
|
62
|
+
if (userIdent && !data && !submitted && locale !== undefined)
|
|
58
63
|
submit();
|
|
59
|
-
}, [verified, submitted, data, userIdent]);
|
|
64
|
+
}, [verified, submitted, data, userIdent, submitted, locale]);
|
|
60
65
|
return {
|
|
61
66
|
states: {
|
|
62
67
|
loading: loading || disableContinue,
|
|
@@ -13933,7 +13933,7 @@ const indirectDetailsSlotText = {
|
|
|
13933
13933
|
isRegisteredSubRegionIncomeTax: "I am an individual registered for Income Tax purposes in Spain, and withholding tax will apply to any payments made to me.",
|
|
13934
13934
|
qstNumber: "QST Number",
|
|
13935
13935
|
subRegion: "Sub-region",
|
|
13936
|
-
subRegionTaxNumberLabel: "Income
|
|
13936
|
+
subRegionTaxNumberLabel: "Income tax number",
|
|
13937
13937
|
error: {
|
|
13938
13938
|
indirectTaxNumber: "Indirect Tax is required",
|
|
13939
13939
|
fieldRequiredError: "{fieldName} is required",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):n(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-f16aa635.js";import{
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,r){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):n(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(i)try{if(r=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(o[0]===6&&i.label<a[1]){i.label=a[1];a=o;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(o);break}if(a[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-f16aa635.js";import{o as m,f as useEffect,m as h}from"./stencil-hooks.module-aa42e74f.js";import{N,H,n as nn,y as yn,i as isDemo}from"./index.module-a46df001.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./mixins-f60a614c.js";import"./JSS-67b5cff8.js";import{s as sanitizeUrlPath,g as getProps}from"./utils-334c1e34.js";import"./sqm-text-span-view-d776bd9c.js";import{P as PortalVerifyEmailView}from"./sqm-portal-verify-email-view-fb6875bb.js";var SUBMITTED_CONTEXT="sq:verify-submitted";function usePortalVerifyEmail(e){var t=this;var i=e.nextPage,r=e.failedPage,n=e.verifySuccessText,a=e.verifyEmailText,o=e.verifyInvalidText,s=e.networkErrorMessage,l=e.continueText;var u,c,f,d,v,y,h,g;var p=m(SUBMITTED_CONTEXT,false),b=p[0],x=p[1];var T=N();var E=H();var P=nn(),w=P[0],_=P[1],I=_.loading,S=_.data,k=_.errors;var V=new URLSearchParams(yn.location.search);var j=V.get("oobCode");var C=V.get("nextPage");var D=S===undefined&&k===undefined&&!!j;var M=!!(((u=E===null||E===void 0?void 0:E.managedIdentity)===null||u===void 0?void 0:u.emailVerified)||(S===null||S===void 0?void 0:S.verifyManagedIdentityEmail.success));var U=function(){return yn.push({pathname:r,search:V.toString()&&"?"+V.toString()})};var q=function(){V.delete("nextPage");var e=sanitizeUrlPath(C||i);yn.push(e.href)};var z=function(){return __awaiter(t,void 0,void 0,(function(){var e,t;return __generator(this,(function(i){switch(i.label){case 0:x(true);console.log("submit",{submitted:b});if(!j)return[3,2];return[4,w({oobCode:j})];case 1:t=i.sent();if((t instanceof Error||!t.verifyManagedIdentityEmail.success)&&!((e=E===null||E===void 0?void 0:E.managedIdentity)===null||e===void 0?void 0:e.emailVerified)){return[2]}setTimeout((function(){q()}),3e3);i.label=2;case 2:return[2]}}))}))};useEffect((function(){console.log({submitted:b,locale:T});if(M){setTimeout((function(){q()}),3e3);return}if(E&&!S&&!b&&T!==undefined)z()}),[M,b,S,E,b,T]);return{states:{loading:I||D,error:((v=(d=(f=(c=k===null||k===void 0?void 0:k.response)===null||c===void 0?void 0:c.errors)===null||f===void 0?void 0:f[0])===null||d===void 0?void 0:d.extensions)===null||v===void 0?void 0:v.message)||((g=(h=(y=k===null||k===void 0?void 0:k.response)===null||y===void 0?void 0:y.errors)===null||h===void 0?void 0:h[0])===null||g===void 0?void 0:g.message)||(k===null||k===void 0?void 0:k.message)&&s,verified:M},data:{oobCode:j},callbacks:{failed:U,gotoNextPage:q},content:{verifySuccessText:n,verifyEmailText:a,verifyInvalidText:o,continueText:l}}}var PortalVerifyEmail=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.failedPage="/";this.verifyEmailText="Verify your email";this.verifySuccessText="Your email has been verified and you are being redirected. If you are not redirected, please click Continue.";this.verifyInvalidText="The email verification code is invalid or has expired, please try again.";this.continueText="Continue";this.networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?usePortalVerifyEmailDemo(getProps(this)):usePortalVerifyEmail(getProps(this)),t=e.states,i=e.data,r=e.callbacks,n=e.content;return h$1(PortalVerifyEmailView,{states:t,data:i,callbacks:r,content:n})};return e}();function usePortalVerifyEmailDemo(e){return cjs({states:{error:"",loading:false,verified:true},data:{oobCode:"code"},callbacks:{failed:function(){console.log("failed")},gotoNextPage:function(){}},content:{verifySuccessText:e.verifySuccessText,verifyEmailText:e.verifyEmailText,verifyInvalidText:e.verifyInvalidText,continueText:e.continueText}},e.demoData||{},{arrayMerge:function(e,t){return t}})}export{PortalVerifyEmail as sqm_portal_verify_email};
|