@saasquatch/mint-components 2.1.9-14 → 2.1.9-16
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/parseStates-d1effc19.js +16 -0
- package/dist/cjs/sqm-big-stat_46.cjs.entry.js +13 -17
- package/dist/cjs/sqm-email-verification_2.cjs.entry.js +4 -1
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +5 -2
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +8 -0
- package/dist/esm/parseStates-ed75e224.js +14 -0
- package/dist/esm/sqm-big-stat_46.entry.js +9 -13
- package/dist/esm/sqm-email-verification_2.entry.js +4 -1
- package/dist/esm-es5/parseStates-ed75e224.js +1 -0
- package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-115dfc03.system.js +1 -0
- package/dist/mint-components/p-13f3a647.js +1 -0
- package/dist/mint-components/p-1c413a06.system.js +1 -1
- package/dist/mint-components/{p-44071410.entry.js → p-3b2b83d9.entry.js} +8 -8
- package/dist/mint-components/p-a06ee2a3.system.entry.js +1 -0
- package/dist/mint-components/p-ae0a0031.system.entry.js +1 -0
- package/dist/mint-components/{p-4a02d507.entry.js → p-e5c554da.entry.js} +15 -15
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +1 -1
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-9c8abce9.system.entry.js +0 -1
- package/dist/mint-components/p-bb86bb46.system.entry.js +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function parseStates(states) {
|
|
4
|
+
if (typeof states === "string") {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(states);
|
|
7
|
+
}
|
|
8
|
+
catch (e) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
if (typeof states === "object")
|
|
13
|
+
return states;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.parseStates = parseStates;
|
|
@@ -33,6 +33,7 @@ const data = require('./data-e83f8a41.js');
|
|
|
33
33
|
const keys = require('./keys-cff24974.js');
|
|
34
34
|
require('./eventKeys-7af4df4d.js');
|
|
35
35
|
const usePayoutStatus = require('./usePayoutStatus-cf050a03.js');
|
|
36
|
+
const parseStates = require('./parseStates-d1effc19.js');
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
*
|
|
@@ -3214,19 +3215,6 @@ function PayoutStatusAlertView(props) {
|
|
|
3214
3215
|
getButton(states.status))));
|
|
3215
3216
|
}
|
|
3216
3217
|
|
|
3217
|
-
function parseStates(states) {
|
|
3218
|
-
if (typeof states === "string") {
|
|
3219
|
-
try {
|
|
3220
|
-
return JSON.parse(states);
|
|
3221
|
-
}
|
|
3222
|
-
catch (e) {
|
|
3223
|
-
return undefined;
|
|
3224
|
-
}
|
|
3225
|
-
}
|
|
3226
|
-
if (typeof states === "object")
|
|
3227
|
-
return states;
|
|
3228
|
-
}
|
|
3229
|
-
|
|
3230
3218
|
const PayoutStatusAlert = class {
|
|
3231
3219
|
constructor(hostRef) {
|
|
3232
3220
|
index.registerInstance(this, hostRef);
|
|
@@ -3405,7 +3393,7 @@ const PayoutStatusAlert = class {
|
|
|
3405
3393
|
}
|
|
3406
3394
|
};
|
|
3407
3395
|
function useDemoPayoutStatusAlert(props) {
|
|
3408
|
-
const states = parseStates(props.stateController);
|
|
3396
|
+
const states = parseStates.parseStates(props.stateController);
|
|
3409
3397
|
const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-payout-status-alert"
|
|
3410
3398
|
? { ...prev, ...states[key] }
|
|
3411
3399
|
: { ...prev, [`${key}_stateController`]: states[key] }, {});
|
|
@@ -5784,7 +5772,7 @@ function EmptySlot$1() {
|
|
|
5784
5772
|
return (index.h("slot", { name: "empty" }, index.h("sqm-empty", { emptyStateImage: "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png", emptyStateHeader: "Redeem rewards", emptyStateText: "Use your points to redeem rewards once they become available" })));
|
|
5785
5773
|
}
|
|
5786
5774
|
function useRewardExchangeListDemo(props) {
|
|
5787
|
-
const states = parseStates(props.stateController);
|
|
5775
|
+
const states = parseStates.parseStates(props.stateController);
|
|
5788
5776
|
const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-reward-exchange-list"
|
|
5789
5777
|
? { ...prev, ...states[key] }
|
|
5790
5778
|
: { ...prev, [`${key}_stateController`]: states[key] }, {});
|
|
@@ -7766,7 +7754,7 @@ function useDemoTaxAndCash(props) {
|
|
|
7766
7754
|
namespace: data.TAX_CONTEXT_NAMESPACE,
|
|
7767
7755
|
initialValue: "/1",
|
|
7768
7756
|
});
|
|
7769
|
-
const states = parseStates(props.stateController);
|
|
7757
|
+
const states = parseStates.parseStates(props.stateController);
|
|
7770
7758
|
const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-tax-and-cash"
|
|
7771
7759
|
? { ...prev, ...states[key] }
|
|
7772
7760
|
: { ...prev, [`${key}_stateController`]: states[key] }, {});
|
|
@@ -8235,11 +8223,19 @@ const WidgetVerification = class {
|
|
|
8235
8223
|
return extractProps(props, prefix);
|
|
8236
8224
|
}
|
|
8237
8225
|
render() {
|
|
8226
|
+
var _a;
|
|
8238
8227
|
const props = index_module.isDemo()
|
|
8239
8228
|
? useDemoWidgetVerificationInternal(this)
|
|
8240
8229
|
: useWidgetVerification();
|
|
8241
8230
|
if (props.loading)
|
|
8242
8231
|
return index.h("sl-spinner", null);
|
|
8232
|
+
// Check if partner modal state indicates verification is complete (open: false)
|
|
8233
|
+
const partnerState = typeof props["sqm-partner-info-modal_stateController"] === "string"
|
|
8234
|
+
? parseStates.parseStates(props["sqm-partner-info-modal_stateController"])
|
|
8235
|
+
: props["sqm-partner-info-modal_stateController"];
|
|
8236
|
+
if (props.showPartnerModal && ((_a = partnerState === null || partnerState === void 0 ? void 0 : partnerState.states) === null || _a === void 0 ? void 0 : _a.open) === false) {
|
|
8237
|
+
return index.h("div", null);
|
|
8238
|
+
}
|
|
8243
8239
|
const style = {
|
|
8244
8240
|
Dialog: {
|
|
8245
8241
|
"&::part(panel)": {
|
|
@@ -8300,7 +8296,7 @@ function useDemoWidgetVerificationInternal(props) {
|
|
|
8300
8296
|
initialValue: undefined,
|
|
8301
8297
|
});
|
|
8302
8298
|
const setContext = index_module.En(keys.VERIFICATION_PARENT_NAMESPACE);
|
|
8303
|
-
const states = parseStates(props.stateController);
|
|
8299
|
+
const states = parseStates.parseStates(props.stateController);
|
|
8304
8300
|
const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-widget-verification"
|
|
8305
8301
|
? { ...prev, ...states[key] }
|
|
8306
8302
|
: { ...prev, [`${key}_stateController`]: states[key] }, {});
|
|
@@ -13,6 +13,7 @@ const sqmTextSpanView = require('./sqm-text-span-view-f274fdf2.js');
|
|
|
13
13
|
const sqmPartnerInfoModalView = require('./sqm-partner-info-modal-view-2d6e89a4.js');
|
|
14
14
|
const keys = require('./keys-cff24974.js');
|
|
15
15
|
const eventKeys = require('./eventKeys-7af4df4d.js');
|
|
16
|
+
const parseStates = require('./parseStates-d1effc19.js');
|
|
16
17
|
const useVerificationEmail = require('./useVerificationEmail-994bc32f.js');
|
|
17
18
|
|
|
18
19
|
const UpsertUserEmailMutation = index_module.dist.gql `
|
|
@@ -754,6 +755,8 @@ function useDemoPartnerInfoModal(props) {
|
|
|
754
755
|
const [countryCode, setCountryCode] = domContextHooks_module.useState("US");
|
|
755
756
|
const [currency, setCurrency] = domContextHooks_module.useState("");
|
|
756
757
|
const [error, setError] = domContextHooks_module.useState("");
|
|
758
|
+
const parsed = parseStates.parseStates(props.stateController);
|
|
759
|
+
const stateOverride = (parsed === null || parsed === void 0 ? void 0 : parsed["sqm-partner-info-modal"]) || parsed || {};
|
|
757
760
|
// @ts-ignore
|
|
758
761
|
return cjs.cjs({
|
|
759
762
|
states: {
|
|
@@ -808,7 +811,7 @@ function useDemoPartnerInfoModal(props) {
|
|
|
808
811
|
supportDescriptionExistingPartner: props.supportDescriptionExistingPartner,
|
|
809
812
|
modalHeaderExistingPartner: props.modalHeaderExistingPartner,
|
|
810
813
|
},
|
|
811
|
-
}, props.demoData ||
|
|
814
|
+
}, props.demoData || stateOverride, { arrayMerge: (_, a) => a });
|
|
812
815
|
}
|
|
813
816
|
|
|
814
817
|
exports.sqm_email_verification = WidgetEmailVerification;
|
|
@@ -2,13 +2,14 @@ import { isDemo } from "@saasquatch/component-boilerplate";
|
|
|
2
2
|
import { useState, withHooks } from "@saasquatch/stencil-hooks";
|
|
3
3
|
import { Component, Prop, h } from "@stencil/core";
|
|
4
4
|
import deepmerge from "deepmerge";
|
|
5
|
+
import { parseStates } from "../../utils/parseStates";
|
|
5
6
|
import { getProps } from "../../utils/utils";
|
|
6
7
|
import { PartnerInfoModalContentView, PartnerInfoModalView, } from "./sqm-partner-info-modal-view";
|
|
7
8
|
import { usePartnerInfoModal, } from "./usePartnerInfoModal";
|
|
8
9
|
/**
|
|
9
10
|
* @uiName Partner Info Modal
|
|
10
11
|
* @exampleGroup Tax and Cash
|
|
11
|
-
* @validParents ["sqm-portal-container", "sqm-portal-frame", "div", "sqb-program-section", "sqb-conditional-section"]
|
|
12
|
+
* @validParents ["sqm-portal-container", "sqm-portal-frame", "div", "sqm-divided-layout", "sqb-program-section", "sqb-conditional-section"]
|
|
12
13
|
* @example Partner Info Modal - <sqm-partner-info-modal></sqm-partner-info-modal>
|
|
13
14
|
*/
|
|
14
15
|
export class PartnerInfoModal {
|
|
@@ -520,6 +521,8 @@ function useDemoPartnerInfoModal(props) {
|
|
|
520
521
|
const [countryCode, setCountryCode] = useState("US");
|
|
521
522
|
const [currency, setCurrency] = useState("");
|
|
522
523
|
const [error, setError] = useState("");
|
|
524
|
+
const parsed = parseStates(props.stateController);
|
|
525
|
+
const stateOverride = (parsed === null || parsed === void 0 ? void 0 : parsed["sqm-partner-info-modal"]) || parsed || {};
|
|
523
526
|
// @ts-ignore
|
|
524
527
|
return deepmerge({
|
|
525
528
|
states: {
|
|
@@ -574,5 +577,5 @@ function useDemoPartnerInfoModal(props) {
|
|
|
574
577
|
supportDescriptionExistingPartner: props.supportDescriptionExistingPartner,
|
|
575
578
|
modalHeaderExistingPartner: props.modalHeaderExistingPartner,
|
|
576
579
|
},
|
|
577
|
-
}, props.demoData ||
|
|
580
|
+
}, props.demoData || stateOverride, { arrayMerge: (_, a) => a });
|
|
578
581
|
}
|
|
@@ -205,11 +205,19 @@ export class WidgetVerification {
|
|
|
205
205
|
return extractProps(props, prefix);
|
|
206
206
|
}
|
|
207
207
|
render() {
|
|
208
|
+
var _a;
|
|
208
209
|
const props = isDemo()
|
|
209
210
|
? useDemoWidgetVerificationInternal(this)
|
|
210
211
|
: useWidgetVerification();
|
|
211
212
|
if (props.loading)
|
|
212
213
|
return h("sl-spinner", null);
|
|
214
|
+
// Check if partner modal state indicates verification is complete (open: false)
|
|
215
|
+
const partnerState = typeof props["sqm-partner-info-modal_stateController"] === "string"
|
|
216
|
+
? parseStates(props["sqm-partner-info-modal_stateController"])
|
|
217
|
+
: props["sqm-partner-info-modal_stateController"];
|
|
218
|
+
if (props.showPartnerModal && ((_a = partnerState === null || partnerState === void 0 ? void 0 : partnerState.states) === null || _a === void 0 ? void 0 : _a.open) === false) {
|
|
219
|
+
return h("div", null);
|
|
220
|
+
}
|
|
213
221
|
const style = {
|
|
214
222
|
Dialog: {
|
|
215
223
|
"&::part(panel)": {
|
|
@@ -29,6 +29,7 @@ import { T as TAX_CONTEXT_NAMESPACE, a as TAX_FORM_CONTEXT_NAMESPACE, U as USER_
|
|
|
29
29
|
import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
|
|
30
30
|
import './eventKeys-f76b6a03.js';
|
|
31
31
|
import { u as usePayoutStatus } from './usePayoutStatus-fa504d49.js';
|
|
32
|
+
import { p as parseStates } from './parseStates-ed75e224.js';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
*
|
|
@@ -3210,19 +3211,6 @@ function PayoutStatusAlertView(props) {
|
|
|
3210
3211
|
getButton(states.status))));
|
|
3211
3212
|
}
|
|
3212
3213
|
|
|
3213
|
-
function parseStates(states) {
|
|
3214
|
-
if (typeof states === "string") {
|
|
3215
|
-
try {
|
|
3216
|
-
return JSON.parse(states);
|
|
3217
|
-
}
|
|
3218
|
-
catch (e) {
|
|
3219
|
-
return undefined;
|
|
3220
|
-
}
|
|
3221
|
-
}
|
|
3222
|
-
if (typeof states === "object")
|
|
3223
|
-
return states;
|
|
3224
|
-
}
|
|
3225
|
-
|
|
3226
3214
|
const PayoutStatusAlert = class {
|
|
3227
3215
|
constructor(hostRef) {
|
|
3228
3216
|
registerInstance(this, hostRef);
|
|
@@ -8231,11 +8219,19 @@ const WidgetVerification = class {
|
|
|
8231
8219
|
return extractProps(props, prefix);
|
|
8232
8220
|
}
|
|
8233
8221
|
render() {
|
|
8222
|
+
var _a;
|
|
8234
8223
|
const props = isDemo()
|
|
8235
8224
|
? useDemoWidgetVerificationInternal(this)
|
|
8236
8225
|
: useWidgetVerification();
|
|
8237
8226
|
if (props.loading)
|
|
8238
8227
|
return h$1("sl-spinner", null);
|
|
8228
|
+
// Check if partner modal state indicates verification is complete (open: false)
|
|
8229
|
+
const partnerState = typeof props["sqm-partner-info-modal_stateController"] === "string"
|
|
8230
|
+
? parseStates(props["sqm-partner-info-modal_stateController"])
|
|
8231
|
+
: props["sqm-partner-info-modal_stateController"];
|
|
8232
|
+
if (props.showPartnerModal && ((_a = partnerState === null || partnerState === void 0 ? void 0 : partnerState.states) === null || _a === void 0 ? void 0 : _a.open) === false) {
|
|
8233
|
+
return h$1("div", null);
|
|
8234
|
+
}
|
|
8239
8235
|
const style = {
|
|
8240
8236
|
Dialog: {
|
|
8241
8237
|
"&::part(panel)": {
|
|
@@ -9,6 +9,7 @@ import { T as TextSpanView } from './sqm-text-span-view-738acfb3.js';
|
|
|
9
9
|
import { a as PartnerInfoModalContentView, P as PartnerInfoModalView } from './sqm-partner-info-modal-view-f85b5a08.js';
|
|
10
10
|
import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
|
|
11
11
|
import { T as TAX_FORM_UPDATED_EVENT_KEY } from './eventKeys-f76b6a03.js';
|
|
12
|
+
import { p as parseStates } from './parseStates-ed75e224.js';
|
|
12
13
|
import { u as useVerificationEmail } from './useVerificationEmail-cb3d51e3.js';
|
|
13
14
|
|
|
14
15
|
const UpsertUserEmailMutation = dist.gql `
|
|
@@ -750,6 +751,8 @@ function useDemoPartnerInfoModal(props) {
|
|
|
750
751
|
const [countryCode, setCountryCode] = useState("US");
|
|
751
752
|
const [currency, setCurrency] = useState("");
|
|
752
753
|
const [error, setError] = useState("");
|
|
754
|
+
const parsed = parseStates(props.stateController);
|
|
755
|
+
const stateOverride = (parsed === null || parsed === void 0 ? void 0 : parsed["sqm-partner-info-modal"]) || parsed || {};
|
|
753
756
|
// @ts-ignore
|
|
754
757
|
return cjs({
|
|
755
758
|
states: {
|
|
@@ -804,7 +807,7 @@ function useDemoPartnerInfoModal(props) {
|
|
|
804
807
|
supportDescriptionExistingPartner: props.supportDescriptionExistingPartner,
|
|
805
808
|
modalHeaderExistingPartner: props.modalHeaderExistingPartner,
|
|
806
809
|
},
|
|
807
|
-
}, props.demoData ||
|
|
810
|
+
}, props.demoData || stateOverride, { arrayMerge: (_, a) => a });
|
|
808
811
|
}
|
|
809
812
|
|
|
810
813
|
export { WidgetEmailVerification as sqm_email_verification, PartnerInfoModal as sqm_partner_info_modal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function parseStates(t){if(typeof t==="string"){try{return JSON.parse(t)}catch(t){return undefined}}if(typeof t==="object")return t}export{parseStates as p};
|