@saasquatch/mint-components 1.4.2 → 1.4.3-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sqm-divided-layout_26.cjs.entry.js +7 -5
- package/dist/cjs/{sqm-hero-view-bb3d00a1.js → sqm-hero-view-783ec385.js} +4 -19
- package/dist/cjs/sqm-hero.cjs.entry.js +2 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +3 -1
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +4 -2
- package/dist/cjs/utilities-21657336.js +28 -0
- package/dist/collection/components/sqm-portal-login/usePortalLogin.js +4 -2
- package/dist/collection/components/sqm-portal-reset-password/usePortalResetPassword.js +3 -1
- package/dist/collection/components/sqm-portal-verify-email/usePortalVerifyEmail.js +4 -2
- package/dist/collection/utilities.js +6 -0
- package/dist/esm/sqm-divided-layout_26.entry.js +7 -5
- package/dist/esm/{sqm-hero-view-bfd8abd1.js → sqm-hero-view-02144ced.js} +1 -16
- package/dist/esm/sqm-hero.entry.js +2 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +3 -1
- package/dist/esm/sqm-portal-verify-email.entry.js +4 -2
- package/dist/esm/utilities-63ba88bc.js +24 -0
- package/dist/esm-es5/sqm-divided-layout_26.entry.js +1 -1
- package/dist/esm-es5/sqm-hero-view-02144ced.js +1 -0
- package/dist/esm-es5/sqm-hero.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/utilities-63ba88bc.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-2bc94910.system.entry.js +1 -0
- package/dist/mint-components/p-49e3f8f1.js +1 -0
- package/dist/mint-components/p-4ab42513.js +1 -0
- package/dist/mint-components/p-57fe3fe6.system.entry.js +1 -0
- package/dist/mint-components/p-5d613ac4.entry.js +1 -0
- package/dist/mint-components/p-66cae6b3.entry.js +230 -0
- package/dist/mint-components/p-696e3217.system.entry.js +1 -0
- package/dist/mint-components/p-6aa43483.entry.js +1 -0
- package/dist/mint-components/p-89479f63.system.entry.js +1 -0
- package/dist/mint-components/p-b83fa0d3.system.js +1 -0
- package/dist/mint-components/p-bf26396f.system.js +1 -1
- package/dist/mint-components/p-cd3fa54f.entry.js +1 -0
- package/dist/mint-components/p-d9a3caba.system.js +1 -0
- package/dist/types/utilities.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm-es5/sqm-hero-view-bfd8abd1.js +0 -1
- package/dist/mint-components/p-192539d2.entry.js +0 -1
- package/dist/mint-components/p-35476f7e.system.js +0 -1
- package/dist/mint-components/p-606506d6.system.entry.js +0 -1
- package/dist/mint-components/p-739b3032.js +0 -1
- package/dist/mint-components/p-768b9014.system.entry.js +0 -1
- package/dist/mint-components/p-7cf335a0.entry.js +0 -1
- package/dist/mint-components/p-a565e753.entry.js +0 -1
- package/dist/mint-components/p-c833872f.system.entry.js +0 -1
- package/dist/mint-components/p-db062719.entry.js +0 -230
- package/dist/mint-components/p-e14c15ca.system.entry.js +0 -1
|
@@ -15,6 +15,7 @@ const mixins = require('./mixins-7b7c59fe.js');
|
|
|
15
15
|
const sqmPortalContainerView = require('./sqm-portal-container-view-d144735a.js');
|
|
16
16
|
const sqmPortalSectionView = require('./sqm-portal-section-view-3b008930.js');
|
|
17
17
|
const sqmTextSpanView = require('./sqm-text-span-view-b5ae787b.js');
|
|
18
|
+
const utilities = require('./utilities-21657336.js');
|
|
18
19
|
const sqmLeaderboardRankView = require('./sqm-leaderboard-rank-view-b1b55673.js');
|
|
19
20
|
const reRender = require('./re-render-b1ad512d.js');
|
|
20
21
|
const useDemoBigStat = require('./useDemoBigStat-d7a60992.js');
|
|
@@ -30,7 +31,7 @@ const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-4d7
|
|
|
30
31
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-b595e302.js');
|
|
31
32
|
const sqmAssetCardView = require('./sqm-asset-card-view-07f86880.js');
|
|
32
33
|
const sqmPortalFooterView = require('./sqm-portal-footer-view-08a2efd5.js');
|
|
33
|
-
const sqmHeroView = require('./sqm-hero-view-
|
|
34
|
+
const sqmHeroView = require('./sqm-hero-view-783ec385.js');
|
|
34
35
|
const sqmNameFieldsView = require('./sqm-name-fields-view-24614ac7.js');
|
|
35
36
|
|
|
36
37
|
function DividedLayoutView(props, children) {
|
|
@@ -1413,8 +1414,9 @@ function usePortalLogin(props) {
|
|
|
1413
1414
|
var _a;
|
|
1414
1415
|
if ((_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
|
|
1415
1416
|
urlParams.delete("nextPage");
|
|
1417
|
+
const path = utilities.sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
1416
1418
|
index_module.mn.push({
|
|
1417
|
-
pathname:
|
|
1419
|
+
pathname: path,
|
|
1418
1420
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
1419
1421
|
});
|
|
1420
1422
|
}
|
|
@@ -1431,7 +1433,7 @@ function usePortalLogin(props) {
|
|
|
1431
1433
|
loading,
|
|
1432
1434
|
error: errorMessage,
|
|
1433
1435
|
registerPath: props.registerPath,
|
|
1434
|
-
forgotPasswordPath: props.forgotPasswordPath
|
|
1436
|
+
forgotPasswordPath: props.forgotPasswordPath,
|
|
1435
1437
|
},
|
|
1436
1438
|
callbacks: {
|
|
1437
1439
|
submit,
|
|
@@ -18342,7 +18344,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
|
|
|
18342
18344
|
EmailVerificationSuccess: EmailVerificationSuccess
|
|
18343
18345
|
});
|
|
18344
18346
|
|
|
18345
|
-
const scenario$2 = "@author:derek\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message is displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their password reset code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password is not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"";
|
|
18347
|
+
const scenario$2 = "@author:derek\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message is displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their password reset code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password is not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter as if it were a relative path\r\n Given the component is loaded at <domain>\r\n And the component does not have prop \"nextPage\"\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to <url>\r\n Examples:\r\n | domain | nextPageParamValue | url |\r\n | www.example.com | /activity | https://www.example.com/activity |\r\n | www.example.com | activity | https://www.example.com/activity |\r\n | www.example.com | www.google.com | https://www.example.com/www.google.com |\r\n | www.example.com | //foo.com | https://www.example.com/ |\r\n | www.example.com | activity?foo=bar | https://www.example.com/activity |\r\n | www.example.com | /activity?foo=bar | https://www.example.com/activity |";
|
|
18346
18348
|
|
|
18347
18349
|
const PortalResetPassword_stories = {
|
|
18348
18350
|
title: "Portal Reset Password",
|
|
@@ -18506,7 +18508,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
|
|
|
18506
18508
|
CodeValidating: CodeValidating
|
|
18507
18509
|
});
|
|
18508
18510
|
|
|
18509
|
-
const scenario$3 = "@author:derek\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email takes you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they click \"Continue\"\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they wait 5 seconds\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their verification code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |";
|
|
18511
|
+
const scenario$3 = "@author:derek\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email takes you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they click \"Continue\"\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they wait 5 seconds\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their verification code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter as if it were a relative path\r\n Given the component is loaded at <domain>\r\n And the component does not have prop \"nextPage\"\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n And they are redirected to <url>\r\n Examples:\r\n | domain | nextPageParamValue | url |\r\n | www.example.com | /activity | https://www.example.com/activity |\r\n | www.example.com | activity | https://www.example.com/activity |\r\n | www.example.com | www.google.com | https://www.example.com/www.google.com |\r\n | www.example.com | //foo.com | https://www.example.com/ |\r\n | www.example.com | activity?foo=bar | https://www.example.com/activity |\r\n | www.example.com | /activity?foo=bar | https://www.example.com/activity |";
|
|
18510
18512
|
|
|
18511
18513
|
const PortalVerifyEmail_stories = {
|
|
18512
18514
|
title: "Portal Verify Email",
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index-b0129cd6.js');
|
|
4
|
-
const _extends = require('./extends-0302d27d.js');
|
|
5
|
-
const useCallback = require('./use-callback-fadb2643.js');
|
|
6
4
|
const jssPresetDefault_esm = require('./jss-preset-default.esm-6304d24f.js');
|
|
7
|
-
|
|
8
|
-
// import { IntlMessageFormat } from 'intl-messageformat';
|
|
9
|
-
function isMobile(breakPoint) {
|
|
10
|
-
const [width, setWidth] = _extends.useState(window.innerWidth);
|
|
11
|
-
const handleWindowResize = useCallback.useCallback(() => setWidth(window.innerWidth), []);
|
|
12
|
-
_extends.useEffect(() => {
|
|
13
|
-
window.addEventListener("resize", handleWindowResize);
|
|
14
|
-
return () => window.removeEventListener("resize", handleWindowResize);
|
|
15
|
-
}, []);
|
|
16
|
-
return width > breakPoint ? false : true;
|
|
17
|
-
}
|
|
18
|
-
function isValidColor(teststr) {
|
|
19
|
-
return CSS.supports(`(color: ${teststr})`);
|
|
20
|
-
}
|
|
5
|
+
const utilities = require('./utilities-21657336.js');
|
|
21
6
|
|
|
22
7
|
const paddingList = [
|
|
23
8
|
"var(--sl-spacing-xxx-small)",
|
|
@@ -33,7 +18,7 @@ const paddingList = [
|
|
|
33
18
|
];
|
|
34
19
|
const parseBackground = (provided_bg) => {
|
|
35
20
|
if (provided_bg) {
|
|
36
|
-
if (isValidColor(provided_bg)) {
|
|
21
|
+
if (utilities.isValidColor(provided_bg)) {
|
|
37
22
|
return provided_bg;
|
|
38
23
|
}
|
|
39
24
|
else {
|
|
@@ -53,10 +38,10 @@ function HeroView(props) {
|
|
|
53
38
|
large: 9,
|
|
54
39
|
};
|
|
55
40
|
var index = sizes[size];
|
|
56
|
-
if (isMobile(767)) {
|
|
41
|
+
if (utilities.isMobile(767)) {
|
|
57
42
|
index = index - 2;
|
|
58
43
|
}
|
|
59
|
-
else if (isMobile(1023)) {
|
|
44
|
+
else if (utilities.isMobile(1023)) {
|
|
60
45
|
index = index - 1;
|
|
61
46
|
}
|
|
62
47
|
return half ? paddingList[index - 2] : paddingList[index];
|
|
@@ -7,7 +7,8 @@ const _extends = require('./extends-0302d27d.js');
|
|
|
7
7
|
require('./use-callback-fadb2643.js');
|
|
8
8
|
require('./jss-preset-default.esm-6304d24f.js');
|
|
9
9
|
const utils = require('./utils-95e5317c.js');
|
|
10
|
-
|
|
10
|
+
require('./utilities-21657336.js');
|
|
11
|
+
const sqmHeroView = require('./sqm-hero-view-783ec385.js');
|
|
11
12
|
|
|
12
13
|
const Hero = class {
|
|
13
14
|
constructor(hostRef) {
|
|
@@ -11,6 +11,7 @@ require('./jss-preset-default.esm-6304d24f.js');
|
|
|
11
11
|
const cjs = require('./cjs-1066ec21.js');
|
|
12
12
|
require('./mixins-7b7c59fe.js');
|
|
13
13
|
require('./sqm-text-span-view-b5ae787b.js');
|
|
14
|
+
const utilities = require('./utilities-21657336.js');
|
|
14
15
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-4d78fd6d.js');
|
|
15
16
|
|
|
16
17
|
function usePortalResetPassword(props) {
|
|
@@ -38,8 +39,9 @@ function usePortalResetPassword(props) {
|
|
|
38
39
|
};
|
|
39
40
|
const gotoNextPage = () => {
|
|
40
41
|
urlParams.delete("nextPage");
|
|
42
|
+
const path = utilities.sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
41
43
|
index_module.mn.push({
|
|
42
|
-
pathname:
|
|
44
|
+
pathname: path,
|
|
43
45
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
44
46
|
});
|
|
45
47
|
};
|
|
@@ -10,6 +10,7 @@ require('./jss-preset-default.esm-6304d24f.js');
|
|
|
10
10
|
const cjs = require('./cjs-1066ec21.js');
|
|
11
11
|
require('./mixins-7b7c59fe.js');
|
|
12
12
|
require('./sqm-text-span-view-b5ae787b.js');
|
|
13
|
+
const utilities = require('./utilities-21657336.js');
|
|
13
14
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-b595e302.js');
|
|
14
15
|
|
|
15
16
|
function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
@@ -31,8 +32,9 @@ function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
|
31
32
|
};
|
|
32
33
|
const gotoNextPage = () => {
|
|
33
34
|
urlParams.delete("nextPage");
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const path = utilities.sanitizeUrlPath(nextPageOverride || nextPage);
|
|
36
|
+
index_module.mn.push({
|
|
37
|
+
pathname: path,
|
|
36
38
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
37
39
|
});
|
|
38
40
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const _extends = require('./extends-0302d27d.js');
|
|
4
|
+
const useCallback = require('./use-callback-fadb2643.js');
|
|
5
|
+
|
|
6
|
+
// import { IntlMessageFormat } from 'intl-messageformat';
|
|
7
|
+
function isMobile(breakPoint) {
|
|
8
|
+
const [width, setWidth] = _extends.useState(window.innerWidth);
|
|
9
|
+
const handleWindowResize = useCallback.useCallback(() => setWidth(window.innerWidth), []);
|
|
10
|
+
_extends.useEffect(() => {
|
|
11
|
+
window.addEventListener("resize", handleWindowResize);
|
|
12
|
+
return () => window.removeEventListener("resize", handleWindowResize);
|
|
13
|
+
}, []);
|
|
14
|
+
return width > breakPoint ? false : true;
|
|
15
|
+
}
|
|
16
|
+
function isValidColor(teststr) {
|
|
17
|
+
return CSS.supports(`(color: ${teststr})`);
|
|
18
|
+
}
|
|
19
|
+
function sanitizeUrlPath(path) {
|
|
20
|
+
const url = new URL(path, window.location.href);
|
|
21
|
+
const cleanUrl = new URL(window.location.href);
|
|
22
|
+
cleanUrl.pathname = url.pathname;
|
|
23
|
+
return cleanUrl.pathname;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.isMobile = isMobile;
|
|
27
|
+
exports.isValidColor = isValidColor;
|
|
28
|
+
exports.sanitizeUrlPath = sanitizeUrlPath;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import jsonpointer from "jsonpointer";
|
|
2
2
|
import { useEffect, useState } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { navigation, useAuthenticateWithEmailAndPasswordMutation, } from "@saasquatch/component-boilerplate";
|
|
4
|
+
import { sanitizeUrlPath } from "../../utilities";
|
|
4
5
|
export function usePortalLogin(props) {
|
|
5
6
|
var _a, _b, _c, _d;
|
|
6
7
|
const [request, { loading, errors, data }] = useAuthenticateWithEmailAndPasswordMutation();
|
|
@@ -20,8 +21,9 @@ export function usePortalLogin(props) {
|
|
|
20
21
|
var _a;
|
|
21
22
|
if ((_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
|
|
22
23
|
urlParams.delete("nextPage");
|
|
24
|
+
const path = sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
23
25
|
navigation.push({
|
|
24
|
-
pathname:
|
|
26
|
+
pathname: path,
|
|
25
27
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
26
28
|
});
|
|
27
29
|
}
|
|
@@ -38,7 +40,7 @@ export function usePortalLogin(props) {
|
|
|
38
40
|
loading,
|
|
39
41
|
error: errorMessage,
|
|
40
42
|
registerPath: props.registerPath,
|
|
41
|
-
forgotPasswordPath: props.forgotPasswordPath
|
|
43
|
+
forgotPasswordPath: props.forgotPasswordPath,
|
|
42
44
|
},
|
|
43
45
|
callbacks: {
|
|
44
46
|
submit,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import jsonpointer from "jsonpointer";
|
|
2
2
|
import { useEffect, useState } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { navigation, useVerifyPasswordResetCodeMutation, useResetPasswordMutation, } from "@saasquatch/component-boilerplate";
|
|
4
|
+
import { sanitizeUrlPath } from "../../utilities";
|
|
4
5
|
export function usePortalResetPassword(props) {
|
|
5
6
|
var _a, _b, _c, _d, _e, _f;
|
|
6
7
|
const [reset, setReset] = useState(false);
|
|
@@ -26,8 +27,9 @@ export function usePortalResetPassword(props) {
|
|
|
26
27
|
};
|
|
27
28
|
const gotoNextPage = () => {
|
|
28
29
|
urlParams.delete("nextPage");
|
|
30
|
+
const path = sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
29
31
|
navigation.push({
|
|
30
|
-
pathname:
|
|
32
|
+
pathname: path,
|
|
31
33
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
32
34
|
});
|
|
33
35
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from "@saasquatch/universal-hooks";
|
|
2
2
|
import { navigation, useUserIdentity, useVerifyEmailMutation, } from "@saasquatch/component-boilerplate";
|
|
3
|
+
import { sanitizeUrlPath } from "../../utilities";
|
|
3
4
|
export function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
4
5
|
var _a, _b, _c, _d, _e;
|
|
5
6
|
const [verified, setVerified] = useState(false);
|
|
@@ -19,8 +20,9 @@ export function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
|
19
20
|
};
|
|
20
21
|
const gotoNextPage = () => {
|
|
21
22
|
urlParams.delete("nextPage");
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const path = sanitizeUrlPath(nextPageOverride || nextPage);
|
|
24
|
+
navigation.push({
|
|
25
|
+
pathname: path,
|
|
24
26
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
25
27
|
});
|
|
26
28
|
};
|
|
@@ -19,3 +19,9 @@ export function isMobile(breakPoint) {
|
|
|
19
19
|
export function isValidColor(teststr) {
|
|
20
20
|
return CSS.supports(`(color: ${teststr})`);
|
|
21
21
|
}
|
|
22
|
+
export function sanitizeUrlPath(path) {
|
|
23
|
+
const url = new URL(path, window.location.href);
|
|
24
|
+
const cleanUrl = new URL(window.location.href);
|
|
25
|
+
cleanUrl.pathname = url.pathname;
|
|
26
|
+
return cleanUrl.pathname;
|
|
27
|
+
}
|
|
@@ -11,6 +11,7 @@ import { E as ErrorStyles, H as HostBlock, A as AuthWrapper, a as AuthColumn, b
|
|
|
11
11
|
import { P as PortalContainerView } from './sqm-portal-container-view-73757ca5.js';
|
|
12
12
|
import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
|
|
13
13
|
import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
|
|
14
|
+
import { s as sanitizeUrlPath } from './utilities-63ba88bc.js';
|
|
14
15
|
import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-387f0870.js';
|
|
15
16
|
import { u as useRerenderListener } from './re-render-b8468637.js';
|
|
16
17
|
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-5557504e.js';
|
|
@@ -26,7 +27,7 @@ import { P as PortalResetPasswordView$1 } from './sqm-portal-reset-password-view
|
|
|
26
27
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
|
|
27
28
|
import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
|
|
28
29
|
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-f12d5e5a.js';
|
|
29
|
-
import { H as HeroView } from './sqm-hero-view-
|
|
30
|
+
import { H as HeroView } from './sqm-hero-view-02144ced.js';
|
|
30
31
|
import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
|
|
31
32
|
|
|
32
33
|
function DividedLayoutView(props, children) {
|
|
@@ -1409,8 +1410,9 @@ function usePortalLogin(props) {
|
|
|
1409
1410
|
var _a;
|
|
1410
1411
|
if ((_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
|
|
1411
1412
|
urlParams.delete("nextPage");
|
|
1413
|
+
const path = sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
1412
1414
|
mn.push({
|
|
1413
|
-
pathname:
|
|
1415
|
+
pathname: path,
|
|
1414
1416
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
1415
1417
|
});
|
|
1416
1418
|
}
|
|
@@ -1427,7 +1429,7 @@ function usePortalLogin(props) {
|
|
|
1427
1429
|
loading,
|
|
1428
1430
|
error: errorMessage,
|
|
1429
1431
|
registerPath: props.registerPath,
|
|
1430
|
-
forgotPasswordPath: props.forgotPasswordPath
|
|
1432
|
+
forgotPasswordPath: props.forgotPasswordPath,
|
|
1431
1433
|
},
|
|
1432
1434
|
callbacks: {
|
|
1433
1435
|
submit,
|
|
@@ -18338,7 +18340,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
|
|
|
18338
18340
|
EmailVerificationSuccess: EmailVerificationSuccess
|
|
18339
18341
|
});
|
|
18340
18342
|
|
|
18341
|
-
const scenario$2 = "@author:derek\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message is displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their password reset code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password is not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"";
|
|
18343
|
+
const scenario$2 = "@author:derek\r\n@owner:ian\r\nFeature: Reset Password\r\n\r\n Background: A user in on the password reset page\r\n Given a user who has been redirected to the password reset page\r\n\r\n @motivating\r\n Scenario: Users can reset their password\r\n Given a user has a valid oob code as a url query parameter\r\n When they enter their password twice\r\n And they click \"Update\"\r\n Then their password is updated\r\n And a banner with a success message is displayed\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario Outline: Users cannot reset their password with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their password reset code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users must enter the same password twice to successfully reset their password\r\n Given a user has been redirected to the password reset page\r\n And they have a valid oob code as a url query parameter\r\n When they enter two different passwords into the password reset form\r\n And they click \"Update\"\r\n Then their password is not be reset\r\n And an error banner stating the input passwords must match appears\r\n And their password is not be reset\r\n When they enter the same password twice\r\n And they click \"Update\"\r\n Then a banner appears with a success message\r\n And they can log in with their new password\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has entered their password twice\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter as if it were a relative path\r\n Given the component is loaded at <domain>\r\n And the component does not have prop \"nextPage\"\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n When they click \"Update\"\r\n Then their password is updated\r\n And they are redirected to <url>\r\n Examples:\r\n | domain | nextPageParamValue | url |\r\n | www.example.com | /activity | https://www.example.com/activity |\r\n | www.example.com | activity | https://www.example.com/activity |\r\n | www.example.com | www.google.com | https://www.example.com/www.google.com |\r\n | www.example.com | //foo.com | https://www.example.com/ |\r\n | www.example.com | activity?foo=bar | https://www.example.com/activity |\r\n | www.example.com | /activity?foo=bar | https://www.example.com/activity |";
|
|
18342
18344
|
|
|
18343
18345
|
const PortalResetPassword_stories = {
|
|
18344
18346
|
title: "Portal Reset Password",
|
|
@@ -18502,7 +18504,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
|
|
|
18502
18504
|
CodeValidating: CodeValidating
|
|
18503
18505
|
});
|
|
18504
18506
|
|
|
18505
|
-
const scenario$3 = "@author:derek\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email takes you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they click \"Continue\"\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they wait 5 seconds\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their verification code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |";
|
|
18507
|
+
const scenario$3 = "@author:derek\r\n@owner:ian\r\nFeature: Verify Email\r\n\r\n Background: A user is on the email verification page\r\n Given a user who has been redirected to the email verification page\r\n\r\n @motivating\r\n Scenario: Verifying your email takes you to the portal login page\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they click \"Continue\"\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are automatically redirected if they dont click \"Continue\"\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email is validated\r\n Then a button that says \"Continue\" appears\r\n When they wait 5 seconds\r\n Then they are redirected to login\r\n\r\n @motivating\r\n Scenario: Users are notified if verifying their email has failed\r\n Given a user has a valid oob code as a url query parameter\r\n When they click \"Verify Email\"\r\n Then the button enters a loading state\r\n When their email fails to be validated\r\n Then an banner is shown stating that an error occured\r\n\r\n @motivating\r\n Scenario Outline: Users cannot verify their email with an invalid or missing oob code\r\n Given a user has a <oobCode> as a url query parameter\r\n And the component <mayHave> \"failed-page\" with <value>\r\n Then they see an error message saying that their verification code is invalid/expired\r\n When they click \"Continue\"\r\n Then they are redirected to <redirectPath>\r\n Examples:\r\n | oobCode | mayHave | value | redirectPath |\r\n | invalid oob code | doesn't have | N/A | / |\r\n | non existant oob code | doesn't have | N/A | / |\r\n | invalid oob code | has | /login | /login |\r\n | non existant oob code | has | /login | /login |\r\n\r\n @motivating\r\n Scenario: Users are redirected to \"/\" by default\r\n Given the component does not have prop \"nextPage\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/\"\r\n\r\n @motivating\r\n Scenario: Custom redirection can be configured\r\n Given the component has prop \"nextPage\" with value \"/activity\"\r\n And the users url does not contain a \"nextPage\" query parameter\r\n And a user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to \"/activity\"\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter if it exists\r\n Given the component <mayHave> prop \"nextPage\" with <nextPageValue>\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n Then they are redirected to <nextPageParamValue>\r\n Examples:\r\n | mayHave | nextPageValue | nextPageParamValue |\r\n | has | /dashboard | /activity |\r\n | does not have | N/A | /activity |\r\n\r\n @motivating\r\n Scenario Outline: Users are redirected to the value of the nextPage url parameter as if it were a relative path\r\n Given the component is loaded at <domain>\r\n And the component does not have prop \"nextPage\"\r\n And the users url contains a \"nextPage\" query paramater with <nextPageParamValue>\r\n And the user has verified their email\r\n When they click \"Continue\"\r\n And they are redirected to <url>\r\n Examples:\r\n | domain | nextPageParamValue | url |\r\n | www.example.com | /activity | https://www.example.com/activity |\r\n | www.example.com | activity | https://www.example.com/activity |\r\n | www.example.com | www.google.com | https://www.example.com/www.google.com |\r\n | www.example.com | //foo.com | https://www.example.com/ |\r\n | www.example.com | activity?foo=bar | https://www.example.com/activity |\r\n | www.example.com | /activity?foo=bar | https://www.example.com/activity |";
|
|
18506
18508
|
|
|
18507
18509
|
const PortalVerifyEmail_stories = {
|
|
18508
18510
|
title: "Portal Verify Email",
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import { h } from './index-17b4da69.js';
|
|
2
|
-
import { j as useState, e as useEffect } from './extends-3a3f9fe2.js';
|
|
3
|
-
import { u as useCallback } from './use-callback-b38a1523.js';
|
|
4
2
|
import { j as jss, c as create } from './jss-preset-default.esm-71fae192.js';
|
|
5
|
-
|
|
6
|
-
// import { IntlMessageFormat } from 'intl-messageformat';
|
|
7
|
-
function isMobile(breakPoint) {
|
|
8
|
-
const [width, setWidth] = useState(window.innerWidth);
|
|
9
|
-
const handleWindowResize = useCallback(() => setWidth(window.innerWidth), []);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
window.addEventListener("resize", handleWindowResize);
|
|
12
|
-
return () => window.removeEventListener("resize", handleWindowResize);
|
|
13
|
-
}, []);
|
|
14
|
-
return width > breakPoint ? false : true;
|
|
15
|
-
}
|
|
16
|
-
function isValidColor(teststr) {
|
|
17
|
-
return CSS.supports(`(color: ${teststr})`);
|
|
18
|
-
}
|
|
3
|
+
import { i as isValidColor, a as isMobile } from './utilities-63ba88bc.js';
|
|
19
4
|
|
|
20
5
|
const paddingList = [
|
|
21
6
|
"var(--sl-spacing-xxx-small)",
|
|
@@ -3,7 +3,8 @@ import { m as h } from './extends-3a3f9fe2.js';
|
|
|
3
3
|
import './use-callback-b38a1523.js';
|
|
4
4
|
import './jss-preset-default.esm-71fae192.js';
|
|
5
5
|
import { g as getProps } from './utils-454405f5.js';
|
|
6
|
-
import
|
|
6
|
+
import './utilities-63ba88bc.js';
|
|
7
|
+
import { H as HeroView } from './sqm-hero-view-02144ced.js';
|
|
7
8
|
|
|
8
9
|
const Hero = class {
|
|
9
10
|
constructor(hostRef) {
|
|
@@ -7,6 +7,7 @@ import './jss-preset-default.esm-71fae192.js';
|
|
|
7
7
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
8
8
|
import './mixins-10353a39.js';
|
|
9
9
|
import './sqm-text-span-view-1781df94.js';
|
|
10
|
+
import { s as sanitizeUrlPath } from './utilities-63ba88bc.js';
|
|
10
11
|
import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-a4e50da2.js';
|
|
11
12
|
|
|
12
13
|
function usePortalResetPassword(props) {
|
|
@@ -34,8 +35,9 @@ function usePortalResetPassword(props) {
|
|
|
34
35
|
};
|
|
35
36
|
const gotoNextPage = () => {
|
|
36
37
|
urlParams.delete("nextPage");
|
|
38
|
+
const path = sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
37
39
|
mn.push({
|
|
38
|
-
pathname:
|
|
40
|
+
pathname: path,
|
|
39
41
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
40
42
|
});
|
|
41
43
|
};
|
|
@@ -6,6 +6,7 @@ import './jss-preset-default.esm-71fae192.js';
|
|
|
6
6
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
7
7
|
import './mixins-10353a39.js';
|
|
8
8
|
import './sqm-text-span-view-1781df94.js';
|
|
9
|
+
import { s as sanitizeUrlPath } from './utilities-63ba88bc.js';
|
|
9
10
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6f18bac2.js';
|
|
10
11
|
|
|
11
12
|
function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
@@ -27,8 +28,9 @@ function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
|
27
28
|
};
|
|
28
29
|
const gotoNextPage = () => {
|
|
29
30
|
urlParams.delete("nextPage");
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const path = sanitizeUrlPath(nextPageOverride || nextPage);
|
|
32
|
+
mn.push({
|
|
33
|
+
pathname: path,
|
|
32
34
|
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
33
35
|
});
|
|
34
36
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { j as useState, e as useEffect } from './extends-3a3f9fe2.js';
|
|
2
|
+
import { u as useCallback } from './use-callback-b38a1523.js';
|
|
3
|
+
|
|
4
|
+
// import { IntlMessageFormat } from 'intl-messageformat';
|
|
5
|
+
function isMobile(breakPoint) {
|
|
6
|
+
const [width, setWidth] = useState(window.innerWidth);
|
|
7
|
+
const handleWindowResize = useCallback(() => setWidth(window.innerWidth), []);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
window.addEventListener("resize", handleWindowResize);
|
|
10
|
+
return () => window.removeEventListener("resize", handleWindowResize);
|
|
11
|
+
}, []);
|
|
12
|
+
return width > breakPoint ? false : true;
|
|
13
|
+
}
|
|
14
|
+
function isValidColor(teststr) {
|
|
15
|
+
return CSS.supports(`(color: ${teststr})`);
|
|
16
|
+
}
|
|
17
|
+
function sanitizeUrlPath(path) {
|
|
18
|
+
const url = new URL(path, window.location.href);
|
|
19
|
+
const cleanUrl = new URL(window.location.href);
|
|
20
|
+
cleanUrl.pathname = url.pathname;
|
|
21
|
+
return cleanUrl.pathname;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { isMobile as a, isValidColor as i, sanitizeUrlPath as s };
|