@saasquatch/mint-components 1.5.1-3 → 1.5.2
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/CHANGELOG.md +28 -4
- package/dist/cjs/{ShadowViewAddon-8151e5d3.js → ShadowViewAddon-9b256c28.js} +1 -1
- package/dist/cjs/sqm-big-stat_34.cjs.entry.js +15 -20
- package/dist/cjs/sqm-empty_5.cjs.entry.js +1 -1
- package/dist/cjs/sqm-hero.cjs.entry.js +1 -1
- package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +1 -1
- package/dist/cjs/sqm-popup-container.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-footer.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +3 -4
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +3 -4
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +4 -4
- package/dist/cjs/sqm-tabs.cjs.entry.js +1 -1
- package/dist/cjs/{utils-01dbfd4a.js → utils-8ef4fe4a.js} +9 -0
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-checkbox-field/useCheckboxField.js +2 -2
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +1 -1
- package/dist/collection/components/sqm-dropdown-field/useDropdownField.js +2 -2
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +1 -1
- package/dist/collection/components/sqm-name-fields/useNameFields.js +2 -2
- package/dist/collection/components/sqm-portal-login/usePortalLogin.js +4 -5
- package/dist/collection/components/sqm-portal-register/useValidationState.js +2 -2
- package/dist/collection/components/sqm-portal-reset-password/usePortalResetPassword.js +3 -4
- package/dist/collection/components/sqm-portal-verify-email/usePortalVerifyEmail.js +3 -4
- package/dist/collection/utils/utils.js +8 -0
- package/dist/esm/{ShadowViewAddon-e42c07c6.js → ShadowViewAddon-b98faaf1.js} +1 -1
- package/dist/esm/sqm-big-stat_34.entry.js +16 -21
- package/dist/esm/sqm-empty_5.entry.js +1 -1
- package/dist/esm/sqm-hero.entry.js +1 -1
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm/sqm-popup-container.entry.js +1 -1
- package/dist/esm/sqm-portal-footer.entry.js +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +3 -4
- package/dist/esm/sqm-portal-verify-email.entry.js +3 -4
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +4 -4
- package/dist/esm/sqm-tabs.entry.js +1 -1
- package/dist/esm/{utils-1d345130.js → utils-d7bbb0e2.js} +9 -1
- package/dist/esm-es5/{ShadowViewAddon-e42c07c6.js → ShadowViewAddon-b98faaf1.js} +1 -1
- package/dist/esm-es5/sqm-big-stat_34.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_5.entry.js +1 -1
- package/dist/esm-es5/sqm-hero.entry.js +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-profile.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/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-tabs.entry.js +1 -1
- package/dist/esm-es5/{utils-1d345130.js → utils-d7bbb0e2.js} +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-33707867.system.entry.js +1 -0
- package/dist/mint-components/{p-57fc3f18.entry.js → p-342bfc16.entry.js} +1 -1
- package/dist/mint-components/{p-01baf2e6.entry.js → p-35a26fcd.entry.js} +1 -1
- package/dist/mint-components/{p-b593cb86.entry.js → p-36c073ce.entry.js} +1 -1
- package/dist/mint-components/p-436da6b8.system.js +1 -1
- package/dist/mint-components/{p-2d07b528.system.entry.js → p-50019ebe.system.entry.js} +1 -1
- package/dist/mint-components/p-52ca31c9.entry.js +150 -0
- package/dist/mint-components/{p-777b4178.system.entry.js → p-58442d48.system.entry.js} +1 -1
- package/dist/mint-components/{p-87a0f6ff.system.entry.js → p-67958347.system.entry.js} +1 -1
- package/dist/mint-components/{p-6c9bd397.system.js → p-842aa194.system.js} +1 -1
- package/dist/mint-components/{p-81571092.system.entry.js → p-85771eab.system.entry.js} +1 -1
- package/dist/mint-components/{p-9875ace8.entry.js → p-8894c616.entry.js} +1 -1
- package/dist/mint-components/p-8a1a1fb4.system.entry.js +1 -0
- package/dist/mint-components/{p-4e05c65a.js → p-9c5f124f.js} +1 -1
- package/dist/mint-components/p-a624b8d7.system.entry.js +1 -0
- package/dist/mint-components/p-a92677a0.system.js +1 -0
- package/dist/mint-components/{p-ddafff46.entry.js → p-b1766f84.entry.js} +1 -1
- package/dist/mint-components/p-b176c55c.entry.js +9 -0
- package/dist/mint-components/{p-510b0ce1.entry.js → p-c5f46105.entry.js} +1 -1
- package/dist/mint-components/{p-0db65ced.system.entry.js → p-c712f1ca.system.entry.js} +1 -1
- package/dist/mint-components/{p-081b8938.system.entry.js → p-d3e114bb.system.entry.js} +1 -1
- package/dist/mint-components/p-d4cc87d9.entry.js +1 -0
- package/dist/mint-components/p-d5bc4139.entry.js +1 -0
- package/dist/mint-components/p-e17c7323.system.entry.js +1 -0
- package/dist/mint-components/{p-138dcf89.system.entry.js → p-e3a7bab7.system.entry.js} +1 -1
- package/dist/mint-components/{p-3ab9f1ae.system.entry.js → p-e60132f2.system.entry.js} +1 -1
- package/dist/mint-components/{p-c888a6a8.entry.js → p-e7561cbf.entry.js} +1 -1
- package/dist/mint-components/{p-c94a507b.entry.js → p-f209785c.entry.js} +1 -1
- package/dist/mint-components/{p-2c98a3fb.system.entry.js → p-f69ecdf7.system.entry.js} +1 -1
- package/dist/mint-components/{p-55358561.js → p-f702ffef.js} +1 -1
- package/dist/mint-components/{p-47cf728e.entry.js → p-fe887951.entry.js} +1 -1
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field-view.d.ts +2 -1
- package/dist/types/components/sqm-checkbox-field/useCheckboxField.d.ts +1 -5
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field-view.d.ts +2 -1
- package/dist/types/components/sqm-dropdown-field/useDropdownField.d.ts +1 -5
- package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +2 -1
- package/dist/types/components/sqm-name-fields/useNameFields.d.ts +1 -5
- package/dist/types/components/sqm-portal-register/useValidationState.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/mint-components/p-471ed708.system.entry.js +0 -1
- package/dist/mint-components/p-4ab34bd0.system.entry.js +0 -1
- package/dist/mint-components/p-55d9ba7f.system.entry.js +0 -1
- package/dist/mint-components/p-5784d5aa.entry.js +0 -150
- package/dist/mint-components/p-771cf678.entry.js +0 -1
- package/dist/mint-components/p-a0692a19.system.entry.js +0 -1
- package/dist/mint-components/p-bd7879fc.entry.js +0 -9
- package/dist/mint-components/p-c17c4a4d.entry.js +0 -1
- package/dist/mint-components/p-c3f300e8.system.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,14 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [1.5.
|
|
10
|
+
## [1.5.2] - 2022-03-08
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Changed Components:
|
|
15
|
+
- \<sqm-portal-login>
|
|
16
|
+
- Enforce that nextPage redirects are relative
|
|
17
|
+
- \<sqm-portal-reset-password>
|
|
18
|
+
- Enforce that nextPage redirects are relative
|
|
19
|
+
- \<sqm-portal-verify-email>
|
|
20
|
+
- Enforce that nextPage redirects are relative
|
|
21
|
+
|
|
22
|
+
## [1.5.1] - 2022-03-03
|
|
11
23
|
|
|
12
24
|
### Added
|
|
13
25
|
|
|
14
26
|
- Checkbox and dropdown components added for use in \<sqm-portal-register>
|
|
15
|
-
|
|
27
|
+
|
|
28
|
+
- Added Components:
|
|
29
|
+
|
|
16
30
|
- \<sqm-checkbox-field>
|
|
31
|
+
- Required by default but can be optional
|
|
32
|
+
- Allows for a link in checkbox text to support behaviour like linking out to terms and conditions
|
|
33
|
+
- All text is configurable by prop
|
|
34
|
+
- Best used in the register components `terms` or `formData` slots
|
|
35
|
+
- Form field name can be customized with the `checkbox-name` prop
|
|
17
36
|
- \<sqm-dropdown-field>
|
|
37
|
+
- Required by default but can be optional
|
|
38
|
+
- Dropdown options are \<sl-menu-items>
|
|
39
|
+
- All text is configurable by prop
|
|
40
|
+
- Best used in the register components `formData` slot
|
|
41
|
+
- Form field name can be customized with the `dropdown-name` prop
|
|
18
42
|
|
|
19
43
|
## [1.5.0] - 2022-02-23
|
|
20
44
|
|
|
@@ -361,9 +385,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
361
385
|
- \<sqm-popup-container>
|
|
362
386
|
- \<sqm-stencilbook>
|
|
363
387
|
|
|
364
|
-
[unreleased]: https://github.com/saasquatch/program-tools/compare/mint-components@1.5.
|
|
388
|
+
[unreleased]: https://github.com/saasquatch/program-tools/compare/mint-components@1.5.2...HEAD
|
|
389
|
+
[1.5.2]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%401.5.2
|
|
365
390
|
[1.5.1]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%401.5.1
|
|
366
|
-
[unreleased]: https://github.com/saasquatch/program-tools/compare/mint-components@1.5.0...HEAD
|
|
367
391
|
[1.5.0]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%401.5.0
|
|
368
392
|
[1.4.2]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%401.4.2
|
|
369
393
|
[1.4.1]: https://github.com/saasquatch/program-tools/releases/tag/%40saasquatch%2Fmint-components%401.4.1
|
|
@@ -8,7 +8,7 @@ const cjs = require('./cjs-1066ec21.js');
|
|
|
8
8
|
const mixins = require('./mixins-338ca5f1.js');
|
|
9
9
|
const JSS = require('./JSS-a75f3a9a.js');
|
|
10
10
|
const luxon = require('./luxon-59ca7d19.js');
|
|
11
|
-
const utils = require('./utils-
|
|
11
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
12
12
|
const sqmTextSpanView = require('./sqm-text-span-view-ab4ad6ef.js');
|
|
13
13
|
const sqmPortalContainerView = require('./sqm-portal-container-view-2d11ed71.js');
|
|
14
14
|
const sqmPortalSectionView = require('./sqm-portal-section-view-765aae4d.js');
|
|
@@ -15,10 +15,10 @@ const JSS = require('./JSS-a75f3a9a.js');
|
|
|
15
15
|
const reRender = require('./re-render-f41e352c.js');
|
|
16
16
|
const useChildElements = require('./useChildElements-097c3dc9.js');
|
|
17
17
|
require('./luxon-59ca7d19.js');
|
|
18
|
-
const utils = require('./utils-
|
|
18
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
19
19
|
require('./sqm-text-span-view-ab4ad6ef.js');
|
|
20
20
|
require('./sqm-portal-container-view-2d11ed71.js');
|
|
21
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
21
|
+
const ShadowViewAddon = require('./ShadowViewAddon-9b256c28.js');
|
|
22
22
|
require('./sqm-portal-section-view-765aae4d.js');
|
|
23
23
|
|
|
24
24
|
const BigStat = class {
|
|
@@ -123,9 +123,15 @@ const CardFeed = class {
|
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
const
|
|
126
|
+
const FORM_VALIDATION_CONTEXT = "sq:validation-state";
|
|
127
|
+
function useValidationState(formState) {
|
|
128
|
+
const host = index_module.P();
|
|
129
|
+
const [validationState, setValidationState] = stencilHooks_module.y(host, FORM_VALIDATION_CONTEXT, formState);
|
|
130
|
+
return { validationState, setValidationState };
|
|
131
|
+
}
|
|
132
|
+
|
|
127
133
|
function useCheckboxField() {
|
|
128
|
-
const validationState = stencilHooks_module.d(
|
|
134
|
+
const validationState = stencilHooks_module.d(FORM_VALIDATION_CONTEXT);
|
|
129
135
|
const [checked, setChecked] = stencilHooks_module.useState(false);
|
|
130
136
|
return {
|
|
131
137
|
states: {
|
|
@@ -255,9 +261,8 @@ const DividedLayout = class {
|
|
|
255
261
|
}
|
|
256
262
|
};
|
|
257
263
|
|
|
258
|
-
const CONTEXT_NAME$1 = "sq:validation-state";
|
|
259
264
|
function useDropdownField() {
|
|
260
|
-
const validationState = stencilHooks_module.d(
|
|
265
|
+
const validationState = stencilHooks_module.d(FORM_VALIDATION_CONTEXT);
|
|
261
266
|
return {
|
|
262
267
|
states: {
|
|
263
268
|
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
@@ -938,9 +943,8 @@ function useLeaderboardDemo(props) {
|
|
|
938
943
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
939
944
|
}
|
|
940
945
|
|
|
941
|
-
const CONTEXT_NAME$2 = "sq:validation-state";
|
|
942
946
|
function useNameFields(props) {
|
|
943
|
-
const validationState = stencilHooks_module.d(
|
|
947
|
+
const validationState = stencilHooks_module.d(FORM_VALIDATION_CONTEXT);
|
|
944
948
|
return {
|
|
945
949
|
states: {
|
|
946
950
|
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
@@ -1247,10 +1251,8 @@ function usePortalLogin(props) {
|
|
|
1247
1251
|
var _a;
|
|
1248
1252
|
if ((_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
|
|
1249
1253
|
urlParams.delete("nextPage");
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
1253
|
-
});
|
|
1254
|
+
const url = utils.sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
1255
|
+
index_module.dn.push(url.href);
|
|
1254
1256
|
}
|
|
1255
1257
|
}, [(_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token]);
|
|
1256
1258
|
stencilHooks_module.useEffect(() => {
|
|
@@ -1265,7 +1267,7 @@ function usePortalLogin(props) {
|
|
|
1265
1267
|
loading,
|
|
1266
1268
|
error: errorMessage,
|
|
1267
1269
|
registerPath: props.registerPath,
|
|
1268
|
-
forgotPasswordPath: props.forgotPasswordPath
|
|
1270
|
+
forgotPasswordPath: props.forgotPasswordPath,
|
|
1269
1271
|
},
|
|
1270
1272
|
callbacks: {
|
|
1271
1273
|
submit,
|
|
@@ -1347,13 +1349,6 @@ function useLoginDemo(props) {
|
|
|
1347
1349
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
1348
1350
|
}
|
|
1349
1351
|
|
|
1350
|
-
const CONTEXT_NAME$3 = "sq:validation-state";
|
|
1351
|
-
function useValidationState(formState) {
|
|
1352
|
-
const host = index_module.P();
|
|
1353
|
-
const [validationState, setValidationState] = stencilHooks_module.y(host, CONTEXT_NAME$3, formState);
|
|
1354
|
-
return { validationState, setValidationState };
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
1352
|
// This file is a workaround for a bug in web browsers' "native"
|
|
1358
1353
|
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
1359
1354
|
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
@@ -6,7 +6,7 @@ const index = require('./index-b0129cd6.js');
|
|
|
6
6
|
const stencilHooks_module = require('./stencil-hooks.module-87a1f4f7.js');
|
|
7
7
|
require('./extends-08099afd.js');
|
|
8
8
|
const JSS = require('./JSS-a75f3a9a.js');
|
|
9
|
-
const utils = require('./utils-
|
|
9
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
10
10
|
const sqmPortalContainerView = require('./sqm-portal-container-view-2d11ed71.js');
|
|
11
11
|
const sqmPortalSectionView = require('./sqm-portal-section-view-765aae4d.js');
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@ const stencilHooks_module = require('./stencil-hooks.module-87a1f4f7.js');
|
|
|
7
7
|
require('./use-callback-e754042f.js');
|
|
8
8
|
require('./extends-08099afd.js');
|
|
9
9
|
require('./JSS-a75f3a9a.js');
|
|
10
|
-
const utils = require('./utils-
|
|
10
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
11
11
|
const sqmHeroView = require('./sqm-hero-view-d5d46a36.js');
|
|
12
12
|
|
|
13
13
|
const Hero = class {
|
|
@@ -10,7 +10,7 @@ require('./extends-08099afd.js');
|
|
|
10
10
|
const cjs = require('./cjs-1066ec21.js');
|
|
11
11
|
require('./mixins-338ca5f1.js');
|
|
12
12
|
require('./JSS-a75f3a9a.js');
|
|
13
|
-
const utils = require('./utils-
|
|
13
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
14
14
|
const sqmNavigationSidebarItemView = require('./sqm-navigation-sidebar-item-view-bd8b4dfd.js');
|
|
15
15
|
|
|
16
16
|
function useNavigationSidebarItem(props) {
|
|
@@ -7,7 +7,7 @@ const stencilHooks_module = require('./stencil-hooks.module-87a1f4f7.js');
|
|
|
7
7
|
require('./use-callback-e754042f.js');
|
|
8
8
|
const index_module = require('./index.module-fb61a163.js');
|
|
9
9
|
require('./extends-08099afd.js');
|
|
10
|
-
const utils = require('./utils-
|
|
10
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
11
11
|
|
|
12
12
|
const PopupContainerView = (props) => {
|
|
13
13
|
const { states, callbacks } = props;
|
|
@@ -9,7 +9,7 @@ require('./use-callback-e754042f.js');
|
|
|
9
9
|
require('./index.module-fb61a163.js');
|
|
10
10
|
require('./extends-08099afd.js');
|
|
11
11
|
require('./JSS-a75f3a9a.js');
|
|
12
|
-
const utils = require('./utils-
|
|
12
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
13
13
|
const sqmPortalFooterView = require('./sqm-portal-footer-view-8442fd90.js');
|
|
14
14
|
|
|
15
15
|
const PortalFooter = class {
|
|
@@ -10,7 +10,7 @@ const index_module = require('./index.module-fb61a163.js');
|
|
|
10
10
|
require('./extends-08099afd.js');
|
|
11
11
|
const cjs = require('./cjs-1066ec21.js');
|
|
12
12
|
require('./JSS-a75f3a9a.js');
|
|
13
|
-
const utils = require('./utils-
|
|
13
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
14
14
|
require('./sqm-text-span-view-ab4ad6ef.js');
|
|
15
15
|
require('./sqm-portal-container-view-2d11ed71.js');
|
|
16
16
|
const sqmPortalProfileView = require('./sqm-portal-profile-view-b77382f6.js');
|
|
@@ -11,6 +11,7 @@ const jsonpointer = require('./jsonpointer-11327262.js');
|
|
|
11
11
|
const cjs = require('./cjs-1066ec21.js');
|
|
12
12
|
require('./mixins-338ca5f1.js');
|
|
13
13
|
require('./JSS-a75f3a9a.js');
|
|
14
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
14
15
|
require('./sqm-text-span-view-ab4ad6ef.js');
|
|
15
16
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-042073ca.js');
|
|
16
17
|
|
|
@@ -39,10 +40,8 @@ function usePortalResetPassword(props) {
|
|
|
39
40
|
};
|
|
40
41
|
const gotoNextPage = () => {
|
|
41
42
|
urlParams.delete("nextPage");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
45
|
-
});
|
|
43
|
+
const url = utils.sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
44
|
+
index_module.dn.push(url.href);
|
|
46
45
|
};
|
|
47
46
|
const failed = () => {
|
|
48
47
|
index_module.dn.push({
|
|
@@ -10,6 +10,7 @@ require('./extends-08099afd.js');
|
|
|
10
10
|
const cjs = require('./cjs-1066ec21.js');
|
|
11
11
|
require('./mixins-338ca5f1.js');
|
|
12
12
|
require('./JSS-a75f3a9a.js');
|
|
13
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
13
14
|
require('./sqm-text-span-view-ab4ad6ef.js');
|
|
14
15
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-cb3c9c2f.js');
|
|
15
16
|
|
|
@@ -32,10 +33,8 @@ function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
|
32
33
|
};
|
|
33
34
|
const gotoNextPage = () => {
|
|
34
35
|
urlParams.delete("nextPage");
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
38
|
-
});
|
|
36
|
+
const url = utils.sanitizeUrlPath(nextPageOverride || nextPage);
|
|
37
|
+
index_module.dn.push(url.href);
|
|
39
38
|
};
|
|
40
39
|
const submit = async () => {
|
|
41
40
|
if (oobCode) {
|
|
@@ -16,7 +16,7 @@ const reRender = require('./re-render-f41e352c.js');
|
|
|
16
16
|
const useChildElements = require('./useChildElements-097c3dc9.js');
|
|
17
17
|
const luxon = require('./luxon-59ca7d19.js');
|
|
18
18
|
const useReferralTable = require('./useReferralTable-a7fc07c6.js');
|
|
19
|
-
const utils = require('./utils-
|
|
19
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
20
20
|
const sqmTextSpanView = require('./sqm-text-span-view-ab4ad6ef.js');
|
|
21
21
|
|
|
22
22
|
const mockReferralData = (count = 4) => {
|
|
@@ -16,7 +16,7 @@ const reRender = require('./re-render-f41e352c.js');
|
|
|
16
16
|
const useChildElements = require('./useChildElements-097c3dc9.js');
|
|
17
17
|
const luxon = require('./luxon-59ca7d19.js');
|
|
18
18
|
const useReferralTable = require('./useReferralTable-a7fc07c6.js');
|
|
19
|
-
const utils = require('./utils-
|
|
19
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
20
20
|
|
|
21
21
|
const mockRewardData = (count = 4) => {
|
|
22
22
|
const data = [...Array(count)].map(() => getMockData());
|
|
@@ -13,7 +13,7 @@ require('./mixins-338ca5f1.js');
|
|
|
13
13
|
const JSS = require('./JSS-a75f3a9a.js');
|
|
14
14
|
const GenericTableView = require('./GenericTableView-c2a781ea.js');
|
|
15
15
|
const luxon = require('./luxon-59ca7d19.js');
|
|
16
|
-
require('./utils-
|
|
16
|
+
require('./utils-8ef4fe4a.js');
|
|
17
17
|
require('./sqm-text-span-view-ab4ad6ef.js');
|
|
18
18
|
const sqmAssetCardView = require('./sqm-asset-card-view-07420209.js');
|
|
19
19
|
const sqmHeroView = require('./sqm-hero-view-d5d46a36.js');
|
|
@@ -27,7 +27,7 @@ const sqmPortalContainerView = require('./sqm-portal-container-view-2d11ed71.js'
|
|
|
27
27
|
const sqmPortalProfileView = require('./sqm-portal-profile-view-b77382f6.js');
|
|
28
28
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-042073ca.js');
|
|
29
29
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-cb3c9c2f.js');
|
|
30
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
30
|
+
const ShadowViewAddon = require('./ShadowViewAddon-9b256c28.js');
|
|
31
31
|
const sqmPortalSectionView = require('./sqm-portal-section-view-765aae4d.js');
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -4132,7 +4132,7 @@ const PortalEmailVerification = /*#__PURE__*/Object.freeze({
|
|
|
4132
4132
|
EmailVerificationSuccess: EmailVerificationSuccess
|
|
4133
4133
|
});
|
|
4134
4134
|
|
|
4135
|
-
const scenario$7 = "@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\"";
|
|
4135
|
+
const scenario$7 = "@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 <currentUrl>\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 | currentUrl | url |\r\n | https://www.example.com?nextPage=./activity | https://www.example.com/activity |\r\n | https://www.example.com?nextPage=activity | https://www.example.com/activity |\r\n | https://www.example.com?nextPage=/activity | https://www.example.com/activity |\r\n | https://www.example.com?nextPage=www.google.com | https://www.example.com/www.google.com |\r\n | https://www.example.com?nextPage=//foo.com | https://www.example.com/ |\r\n | https://www.example.com?nextPage=https://malicious.example.com | https://www.example.com/ |\r\n | http://www.example.com/nest/page?oob=123&other&nextPage=activity#heading-1 | http://www.example.com/activity |\r\n | https://www.example.com?nextPage=activity?foo=bar | https://www.example.com/activity?foo=bar |\r\n | https://www.example.com?nextPage=%2Factivity%3Ffoo%3Dbar | https://www.example.com/activity?foo=bar |\r\n | https://www.example.com?nextPage=%2Factivity%3Ffoo%3Dbar#hash | https://www.example.com/activity?foo=bar |\r\n | https://www.example.com?nextPage=%2Factivity%3Ffoo%3Dbar%23hash | https://www.example.com/activity?foo=bar#hash |\r\n | https://www.example.com:1337?nextPage=activity | https://www.example.com:1337/activity |\r\n | http://1.1.1.1:1111?nextPage=activity | http://1.1.1.1:1111/activity |\r\n\r\n @landmine\r\n Scenario Outline: Username and password are not persisted on redirects\r\n Given the component is loaded at <currentUrl>\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 | currentUrl | url |\r\n | https://user:pass@www.example.com:444?nextPage=activity | https://www.example.com:444/activity |";
|
|
4136
4136
|
|
|
4137
4137
|
const PortalResetPassword_stories = {
|
|
4138
4138
|
title: "Components/Portal Reset Password",
|
|
@@ -4296,7 +4296,7 @@ const PortalResetPassword = /*#__PURE__*/Object.freeze({
|
|
|
4296
4296
|
CodeValidating: CodeValidating
|
|
4297
4297
|
});
|
|
4298
4298
|
|
|
4299
|
-
const scenario$8 = "@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 |";
|
|
4299
|
+
const scenario$8 = "@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 <currentUrl>\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 | currentUrl | url |\r\n | https://www.example.com?nextPage=./activity | https://www.example.com/activity |\r\n | https://www.example.com?nextPage=activity | https://www.example.com/activity |\r\n | https://www.example.com?nextPage=/activity | https://www.example.com/activity |\r\n | https://www.example.com?nextPage=www.google.com | https://www.example.com/www.google.com |\r\n | https://www.example.com?nextPage=//foo.com | https://www.example.com/ |\r\n | https://www.example.com?nextPage=https://malicious.example.com | https://www.example.com/ |\r\n | http://www.example.com/nest/page?oob=123&other&nextPage=activity#heading-1 | http://www.example.com/activity |\r\n | https://www.example.com?nextPage=activity?foo=bar | https://www.example.com/activity?foo=bar |\r\n | https://www.example.com?nextPage=%2Factivity%3Ffoo%3Dbar | https://www.example.com/activity?foo=bar |\r\n | https://www.example.com?nextPage=%2Factivity%3Ffoo%3Dbar#hash | https://www.example.com/activity?foo=bar |\r\n | https://www.example.com?nextPage=%2Factivity%3Ffoo%3Dbar%23hash | https://www.example.com/activity?foo=bar#hash |\r\n | https://www.example.com:1337?nextPage=activity | https://www.example.com:1337/activity |\r\n | http://1.1.1.1:1111?nextPage=activity | http://1.1.1.1:1111/activity |\r\n\r\n @landmine\r\n Scenario Outline: Username and password are not persisted on redirects\r\n Given the component is loaded at <currentUrl>\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 | currentUrl | url |\r\n | https://user:pass@www.example.com:444?nextPage=activity | https://www.example.com:444/activity |";
|
|
4300
4300
|
|
|
4301
4301
|
const PortalVerifyEmail_stories = {
|
|
4302
4302
|
title: "Components/Portal Verify Email",
|
|
@@ -8,7 +8,7 @@ require('./use-callback-e754042f.js');
|
|
|
8
8
|
const index_module = require('./index.module-fb61a163.js');
|
|
9
9
|
require('./extends-08099afd.js');
|
|
10
10
|
const useChildElements = require('./useChildElements-097c3dc9.js');
|
|
11
|
-
const utils = require('./utils-
|
|
11
|
+
const utils = require('./utils-8ef4fe4a.js');
|
|
12
12
|
|
|
13
13
|
const TabsView = ({ content, placement, }) => {
|
|
14
14
|
// Vertical padding for top & bottom placement, horizontal for left & right.
|
|
@@ -30,8 +30,17 @@ function luxonLocale(locale) {
|
|
|
30
30
|
const language = splitLocale[0];
|
|
31
31
|
const country = splitLocale[1];
|
|
32
32
|
return `${language}-${country.toUpperCase()}`;
|
|
33
|
+
}
|
|
34
|
+
function sanitizeUrlPath(path) {
|
|
35
|
+
const url = new URL(path, window.location.origin);
|
|
36
|
+
const cleanUrl = new URL(window.location.origin);
|
|
37
|
+
cleanUrl.pathname = url.pathname;
|
|
38
|
+
cleanUrl.search = url.search;
|
|
39
|
+
cleanUrl.hash = url.hash;
|
|
40
|
+
return cleanUrl;
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
exports.getMissingProps = getMissingProps;
|
|
36
44
|
exports.getProps = getProps;
|
|
37
45
|
exports.luxonLocale = luxonLocale;
|
|
46
|
+
exports.sanitizeUrlPath = sanitizeUrlPath;
|
|
@@ -176,7 +176,7 @@ export class CheckboxField {
|
|
|
176
176
|
"mutable": false,
|
|
177
177
|
"complexType": {
|
|
178
178
|
"original": "DemoData<CheckboxFieldViewProps>",
|
|
179
|
-
"resolved": "{ states?: { validationErrors?:
|
|
179
|
+
"resolved": "{ states?: { validationErrors?: ValidationErrors; checked: boolean; }; content?: { checkboxName: string; checkboxLabel: string; checkboxLabelLink?: string; checkboxLabelLinkText?: string; checkboxRequired?: boolean; errorMessage: string; }; }",
|
|
180
180
|
"references": {
|
|
181
181
|
"DemoData": {
|
|
182
182
|
"location": "import",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useDomContext } from "@saasquatch/stencil-hooks";
|
|
2
2
|
import { useState } from "@saasquatch/universal-hooks";
|
|
3
|
-
|
|
3
|
+
import { FORM_VALIDATION_CONTEXT, } from "../sqm-portal-register/useValidationState";
|
|
4
4
|
export function useCheckboxField() {
|
|
5
|
-
const validationState = useDomContext(
|
|
5
|
+
const validationState = useDomContext(FORM_VALIDATION_CONTEXT);
|
|
6
6
|
const [checked, setChecked] = useState(false);
|
|
7
7
|
return {
|
|
8
8
|
states: {
|
|
@@ -126,7 +126,7 @@ export class DropdownField {
|
|
|
126
126
|
"mutable": false,
|
|
127
127
|
"complexType": {
|
|
128
128
|
"original": "DemoData<DropdownFieldViewProps>",
|
|
129
|
-
"resolved": "{ states?: { validationErrors?:
|
|
129
|
+
"resolved": "{ states?: { validationErrors?: ValidationErrors; }; content?: { dropdownName: string; dropdownLabel: string; dropdownRequired?: boolean; errorMessage: string; selectOptions?: VNode | VNode[]; }; }",
|
|
130
130
|
"references": {
|
|
131
131
|
"DemoData": {
|
|
132
132
|
"location": "import",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useDomContext } from "@saasquatch/stencil-hooks";
|
|
2
|
-
|
|
2
|
+
import { FORM_VALIDATION_CONTEXT, } from "../sqm-portal-register/useValidationState";
|
|
3
3
|
export function useDropdownField() {
|
|
4
|
-
const validationState = useDomContext(
|
|
4
|
+
const validationState = useDomContext(FORM_VALIDATION_CONTEXT);
|
|
5
5
|
return {
|
|
6
6
|
states: {
|
|
7
7
|
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
@@ -74,7 +74,7 @@ export class NameFields {
|
|
|
74
74
|
"mutable": false,
|
|
75
75
|
"complexType": {
|
|
76
76
|
"original": "DemoData<NameFieldsViewProps>",
|
|
77
|
-
"resolved": "{ states?: { validationErrors?:
|
|
77
|
+
"resolved": "{ states?: { validationErrors?: ValidationErrors; content: { firstNameLabel: string; lastNameLabel: string; }; }; }",
|
|
78
78
|
"references": {
|
|
79
79
|
"DemoData": {
|
|
80
80
|
"location": "import",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useDomContext } from "@saasquatch/stencil-hooks";
|
|
2
|
-
|
|
2
|
+
import { FORM_VALIDATION_CONTEXT, } from "../sqm-portal-register/useValidationState";
|
|
3
3
|
export function useNameFields(props) {
|
|
4
|
-
const validationState = useDomContext(
|
|
4
|
+
const validationState = useDomContext(FORM_VALIDATION_CONTEXT);
|
|
5
5
|
return {
|
|
6
6
|
states: {
|
|
7
7
|
validationErrors: validationState === null || validationState === void 0 ? void 0 : validationState.validationErrors,
|
|
@@ -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 "../../utils/utils";
|
|
4
5
|
export function usePortalLogin(props) {
|
|
5
6
|
var _a, _b, _c, _d;
|
|
6
7
|
const [request, { loading, errors, data }] = useAuthenticateWithEmailAndPasswordMutation();
|
|
@@ -20,10 +21,8 @@ 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");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
26
|
-
});
|
|
24
|
+
const url = sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
25
|
+
navigation.push(url.href);
|
|
27
26
|
}
|
|
28
27
|
}, [(_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token]);
|
|
29
28
|
useEffect(() => {
|
|
@@ -38,7 +37,7 @@ export function usePortalLogin(props) {
|
|
|
38
37
|
loading,
|
|
39
38
|
error: errorMessage,
|
|
40
39
|
registerPath: props.registerPath,
|
|
41
|
-
forgotPasswordPath: props.forgotPasswordPath
|
|
40
|
+
forgotPasswordPath: props.forgotPasswordPath,
|
|
42
41
|
},
|
|
43
42
|
callbacks: {
|
|
44
43
|
submit,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useHost } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { useDomContextState } from "@saasquatch/dom-context-hooks";
|
|
3
|
-
const
|
|
3
|
+
export const FORM_VALIDATION_CONTEXT = "sq:validation-state";
|
|
4
4
|
export function useValidationState(formState) {
|
|
5
5
|
const host = useHost();
|
|
6
|
-
const [validationState, setValidationState] = useDomContextState(host,
|
|
6
|
+
const [validationState, setValidationState] = useDomContextState(host, FORM_VALIDATION_CONTEXT, formState);
|
|
7
7
|
return { validationState, setValidationState };
|
|
8
8
|
}
|
|
@@ -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 "../../utils/utils";
|
|
4
5
|
export function usePortalResetPassword(props) {
|
|
5
6
|
var _a, _b, _c, _d, _e, _f;
|
|
6
7
|
const [reset, setReset] = useState(false);
|
|
@@ -26,10 +27,8 @@ export function usePortalResetPassword(props) {
|
|
|
26
27
|
};
|
|
27
28
|
const gotoNextPage = () => {
|
|
28
29
|
urlParams.delete("nextPage");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
32
|
-
});
|
|
30
|
+
const url = sanitizeUrlPath(nextPageOverride || props.nextPage);
|
|
31
|
+
navigation.push(url.href);
|
|
33
32
|
};
|
|
34
33
|
const failed = () => {
|
|
35
34
|
navigation.push({
|
|
@@ -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 "../../utils/utils";
|
|
3
4
|
export function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
4
5
|
var _a, _b, _c, _d, _e;
|
|
5
6
|
const [verified, setVerified] = useState(false);
|
|
@@ -19,10 +20,8 @@ export function usePortalVerifyEmail({ nextPage, failedPage }) {
|
|
|
19
20
|
};
|
|
20
21
|
const gotoNextPage = () => {
|
|
21
22
|
urlParams.delete("nextPage");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
search: urlParams.toString() && "?" + urlParams.toString(),
|
|
25
|
-
});
|
|
23
|
+
const url = sanitizeUrlPath(nextPageOverride || nextPage);
|
|
24
|
+
navigation.push(url.href);
|
|
26
25
|
};
|
|
27
26
|
const submit = async () => {
|
|
28
27
|
if (oobCode) {
|
|
@@ -39,3 +39,11 @@ export function luxonLocale(locale) {
|
|
|
39
39
|
const country = splitLocale[1];
|
|
40
40
|
return `${language}-${country.toUpperCase()}`;
|
|
41
41
|
}
|
|
42
|
+
export function sanitizeUrlPath(path) {
|
|
43
|
+
const url = new URL(path, window.location.origin);
|
|
44
|
+
const cleanUrl = new URL(window.location.origin);
|
|
45
|
+
cleanUrl.pathname = url.pathname;
|
|
46
|
+
cleanUrl.search = url.search;
|
|
47
|
+
cleanUrl.hash = url.hash;
|
|
48
|
+
return cleanUrl;
|
|
49
|
+
}
|
|
@@ -6,7 +6,7 @@ import { c as cjs } from './cjs-bdfb4486.js';
|
|
|
6
6
|
import { H as HostBlock, A as AuthWrapper, a as AuthColumn, b as AuthButtonsContainer, E as ErrorStyles } from './mixins-59fd94b7.js';
|
|
7
7
|
import { c as createStyleSheet, j as jss, a as create } from './JSS-418cab16.js';
|
|
8
8
|
import { l as luxon } from './luxon-f44215d9.js';
|
|
9
|
-
import { l as luxonLocale } from './utils-
|
|
9
|
+
import { l as luxonLocale } from './utils-d7bbb0e2.js';
|
|
10
10
|
import { T as TextSpanView } from './sqm-text-span-view-020db63f.js';
|
|
11
11
|
import { P as PortalContainerView } from './sqm-portal-container-view-34f26e2a.js';
|
|
12
12
|
import { P as PortalSectionView } from './sqm-portal-section-view-c8d1c727.js';
|