@saasquatch/mint-components 2.0.0-67 → 2.0.0-69
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/{IndirectTaxDetailsView-e5f70b8b.js → IndirectTaxDetailsView-3e88d710.js} +2 -2
- package/dist/cjs/{ShadowViewAddon-cd5c186c.js → ShadowViewAddon-646dec73.js} +10 -4
- package/dist/cjs/{global-8bba5b3a.js → global-39cb0afc.js} +745 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mint-components.cjs.js +2 -2
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-base-registration-form-view-7b95ae7a.js → sqm-base-registration-form-view-69a4b615.js} +9 -4
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +13 -6
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-lead-checkbox-field-view-340acad0.js → sqm-lead-checkbox-field-view-f1c46d4b.js} +1 -1
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +3 -3
- package/dist/cjs/{sqm-lead-input-field-view-06ed3632.js → sqm-lead-input-field-view-6d388092.js} +1 -1
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +3 -3
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-5518eb0d.js → sqm-portal-email-verification-view-6b17e545.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +25 -18
- package/dist/cjs/{sqm-portal-profile-view-615e6975.js → sqm-portal-profile-view-845367bb.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- 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 +14 -11
- package/dist/cjs/{useLeadFormState-fd0445f9.js → useLeadFormState-b355759b.js} +1 -1
- package/dist/cjs/{utils-83d125fa.js → utils-ac82f977.js} +1 -1
- package/dist/collection/components/sqm-base-registration/BaseRegistrationForm.stories.js +2 -2
- package/dist/collection/components/sqm-base-registration/sqm-base-registration-form-view.js +9 -4
- package/dist/collection/components/sqm-big-stat/useBigStat.js +7 -1
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +1 -1
- package/dist/collection/components/sqm-input-field/sqm-input-field.js +1 -1
- package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +1 -1
- package/dist/collection/components/sqm-name-fields/NameFields.stories.js +2 -0
- package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +2 -2
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +31 -1
- package/dist/collection/components/sqm-name-fields/useNameFields.js +1 -0
- package/dist/collection/components/sqm-password-field/sqm-password-field.js +2 -2
- package/dist/collection/components/sqm-portal-google-registration-form/PortalGoogleRegistrationForm.stories.js +1 -0
- package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +4 -4
- package/dist/collection/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.js +22 -15
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +2 -2
- package/dist/collection/global/global.js +14 -3
- package/dist/collection/global/styles.v1.js +733 -0
- package/dist/collection/global/styles.v1.ts +735 -0
- package/dist/esm/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-e5d8767d.js} +2 -2
- package/dist/esm/{ShadowViewAddon-11ffa85d.js → ShadowViewAddon-5928ca9d.js} +10 -4
- package/dist/esm/{global-1099f20d.js → global-943536b9.js} +745 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mint-components.js +2 -2
- package/dist/esm/sqm-banking-info-form_10.entry.js +3 -3
- package/dist/esm/{sqm-base-registration-form-view-1a6bb4b4.js → sqm-base-registration-form-view-9e97d8b4.js} +9 -4
- package/dist/esm/sqm-big-stat_47.entry.js +13 -6
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-email-verification.entry.js +1 -1
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-adcc49c0.js} +1 -1
- package/dist/esm/sqm-lead-checkbox-field.entry.js +3 -3
- package/dist/esm/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-c0b5aed5.js} +1 -1
- package/dist/esm/sqm-lead-input-field.entry.js +3 -3
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-8ceb6302.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/sqm-portal-google-registration-form.entry.js +25 -18
- package/dist/esm/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-2ec60449.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- 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 +14 -11
- package/dist/esm/{useLeadFormState-c379e5d7.js → useLeadFormState-9a652a42.js} +1 -1
- package/dist/esm/{utils-6122971b.js → utils-f27e62dc.js} +1 -1
- package/dist/esm-es5/{IndirectTaxDetailsView-0a57b622.js → IndirectTaxDetailsView-e5d8767d.js} +1 -1
- package/dist/esm-es5/{ShadowViewAddon-11ffa85d.js → ShadowViewAddon-5928ca9d.js} +1 -1
- package/dist/esm-es5/{global-1099f20d.js → global-943536b9.js} +4 -4
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-9e97d8b4.js +1 -0
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-cbafee07.js → sqm-lead-checkbox-field-view-adcc49c0.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-input-field-view-f3775c28.js → sqm-lead-input-field-view-c0b5aed5.js} +1 -1
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -1
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-7d86299c.js → sqm-portal-email-verification-view-8ceb6302.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-3ed13e4d.js → sqm-portal-profile-view-2ec60449.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.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/{useLeadFormState-c379e5d7.js → useLeadFormState-9a652a42.js} +1 -1
- package/dist/esm-es5/{utils-6122971b.js → utils-f27e62dc.js} +1 -1
- package/dist/mint-components/global/styles.v1.ts +735 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/{p-4adf23e7.entry.js → p-06b4fa6a.entry.js} +3 -3
- package/dist/mint-components/{p-aa08457e.system.js → p-08b373b9.system.js} +1 -1
- package/dist/mint-components/{p-6445e926.system.entry.js → p-0ac84da5.system.entry.js} +1 -1
- package/dist/mint-components/{p-14e813a7.system.entry.js → p-0cb51ea1.system.entry.js} +1 -1
- package/dist/mint-components/{p-d2bb770d.system.entry.js → p-11927355.system.entry.js} +1 -1
- package/dist/mint-components/{p-a5c63310.entry.js → p-124af9d6.entry.js} +1 -1
- package/dist/mint-components/{p-d3120982.system.entry.js → p-19de8749.system.entry.js} +1 -1
- package/dist/mint-components/{p-4ce51b1c.system.entry.js → p-1e406d04.system.entry.js} +1 -1
- package/dist/mint-components/{p-010957a1.entry.js → p-20f8e7ca.entry.js} +1 -1
- package/dist/mint-components/{p-6d5bd95a.js → p-252465eb.js} +1 -1
- package/dist/mint-components/{p-aefaec37.entry.js → p-2fd2f22b.entry.js} +1 -1
- package/dist/mint-components/p-37ef2ce1.entry.js +1 -0
- package/dist/mint-components/{p-aa8c6332.js → p-38c4653d.js} +1 -1
- package/dist/mint-components/{p-511c87ce.system.entry.js → p-3fa99fea.system.entry.js} +1 -1
- package/dist/mint-components/p-51a6a779.js +1 -0
- package/dist/mint-components/{p-967a9040.system.js → p-53b49d27.system.js} +1 -1
- package/dist/mint-components/{p-f401ef19.system.entry.js → p-54c250de.system.entry.js} +1 -1
- package/dist/mint-components/{p-e658929b.js → p-58b668a0.js} +4 -4
- package/dist/mint-components/{p-60c14cec.entry.js → p-58f4bf7a.entry.js} +1 -1
- package/dist/mint-components/{p-4c811d12.entry.js → p-5a3e2966.entry.js} +1 -1
- package/dist/mint-components/{p-bec87ac9.system.entry.js → p-5bb24669.system.entry.js} +1 -1
- package/dist/mint-components/{p-c85f204b.system.js → p-6b55555b.system.js} +1 -1
- package/dist/mint-components/{p-f0eae4e6.system.js → p-6dd86003.system.js} +1 -1
- package/dist/mint-components/{p-16ac4d4f.entry.js → p-735c9185.entry.js} +1 -1
- package/dist/mint-components/p-80569911.system.js +1 -0
- package/dist/mint-components/{p-5d059c95.entry.js → p-8677688c.entry.js} +1 -1
- package/dist/mint-components/{p-a217cc8d.entry.js → p-8e913ce5.entry.js} +1 -1
- package/dist/mint-components/p-8ea16fb6.js +1233 -0
- package/dist/mint-components/{p-ed16b35a.js → p-946f8a2c.js} +1 -1
- package/dist/mint-components/{p-ea0bc627.entry.js → p-94ae86fc.entry.js} +1 -1
- package/dist/mint-components/p-95b6e903.entry.js +1 -0
- package/dist/mint-components/{p-56009bf0.system.entry.js → p-9f57e731.system.entry.js} +1 -1
- package/dist/mint-components/{p-00bc7211.js → p-a1b3f61a.js} +1 -1
- package/dist/mint-components/{p-74f43a08.system.js → p-a275725a.system.js} +1 -1
- package/dist/mint-components/{p-22a9114f.system.entry.js → p-a30d7069.system.entry.js} +1 -1
- package/dist/mint-components/{p-c994512c.system.js → p-b5fd4fb6.system.js} +1 -1
- package/dist/mint-components/{p-47c83656.entry.js → p-bef123be.entry.js} +1 -1
- package/dist/mint-components/{p-79a3344f.js → p-c44b3725.js} +1 -1
- package/dist/mint-components/p-c4f275db.system.entry.js +1 -0
- package/dist/mint-components/p-c5f92183.system.entry.js +1 -0
- package/dist/mint-components/{p-18720462.system.entry.js → p-c67ffd25.system.entry.js} +1 -1
- package/dist/mint-components/{p-60465a2d.system.js → p-c90fcb02.system.js} +1 -1
- package/dist/mint-components/{p-7a268047.js → p-d181b17c.js} +1 -1
- package/dist/mint-components/p-d69c0a32.system.entry.js +1 -0
- package/dist/mint-components/{p-6c006998.entry.js → p-db64c957.entry.js} +2 -2
- package/dist/mint-components/{p-4fed8672.js → p-dbb79392.js} +1 -1
- package/dist/mint-components/{p-6d9ce4e5.entry.js → p-e4017ba5.entry.js} +1 -1
- package/dist/mint-components/{p-ad4348c3.system.js → p-ee290b30.system.js} +1 -1
- package/dist/mint-components/{p-b377570a.system.js → p-ee3d2ae4.system.js} +1 -1
- package/dist/mint-components/{p-e0a724dd.system.js → p-f3ccba80.system.js} +19 -19
- package/dist/mint-components/{p-717b6730.system.entry.js → p-fc86ba65.system.entry.js} +1 -1
- package/dist/types/components/sqm-base-registration/sqm-base-registration-form-view.d.ts +2 -1
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -1
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -1
- package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -1
- package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +1 -1
- package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +1 -0
- package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +5 -0
- package/dist/types/components/sqm-name-fields/useNameFields.d.ts +1 -0
- package/dist/types/components/sqm-password-field/sqm-password-field.d.ts +1 -1
- package/dist/types/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.d.ts +2 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/global/styles.v1.d.ts +2 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/sqm-base-registration-form-view-1a6bb4b4.js +0 -1
- package/dist/mint-components/p-1522a7d1.js +0 -1
- package/dist/mint-components/p-71a6e549.system.entry.js +0 -1
- package/dist/mint-components/p-8b5b2acc.entry.js +0 -1
- package/dist/mint-components/p-b21c5311.system.js +0 -1
- package/dist/mint-components/p-c2ac14b7.entry.js +0 -1
- package/dist/mint-components/p-db1a0db1.js +0 -1233
- package/dist/mint-components/p-e9a596ad.system.entry.js +0 -1
- package/dist/mint-components/p-f66e02c7.system.entry.js +0 -1
- package/shoelace/assets/icons/twitter-x.svg +0 -4
- /package/dist/collection/global/{styles.js → styles.v2.js} +0 -0
- /package/dist/collection/global/{styles.ts → styles.v2.ts} +0 -0
- /package/dist/mint-components/global/{styles.ts → styles.v2.ts} +0 -0
- /package/dist/types/global/{styles.d.ts → styles.v2.d.ts} +0 -0
|
@@ -2,11 +2,11 @@ import { isDemo, navigation } from "@saasquatch/component-boilerplate";
|
|
|
2
2
|
import { useState, withHooks } from "@saasquatch/stencil-hooks";
|
|
3
3
|
import { Component, h, Prop, State } from "@stencil/core";
|
|
4
4
|
import deepmerge from "deepmerge";
|
|
5
|
+
import { createStyleSheet } from "../../styling/JSS";
|
|
5
6
|
import { BaseRegistrationFormView } from "../sqm-base-registration/sqm-base-registration-form-view";
|
|
6
7
|
import { PortalRegistrationFormView, } from "../sqm-portal-registration-form/sqm-portal-registration-form-view";
|
|
7
8
|
import { usePortalRegistrationForm } from "../sqm-portal-registration-form/usePortalRegistrationForm";
|
|
8
9
|
import { usePortalGoogleRegistrationForm } from "./usePortalGoogleRegistrationForm";
|
|
9
|
-
import { createStyleSheet } from "../../styling/JSS";
|
|
10
10
|
/**
|
|
11
11
|
* @uiName Google Registration
|
|
12
12
|
* @canvasRenderer always-replace
|
|
@@ -161,7 +161,7 @@ export class PortalGoogleRegistrationForm {
|
|
|
161
161
|
};
|
|
162
162
|
const sheet = createStyleSheet(styles);
|
|
163
163
|
const styleString = sheet.toString();
|
|
164
|
-
const { handleGoogleInit, handleEmailSubmit, showRegistrationForm,
|
|
164
|
+
const { handleGoogleInit, handleEmailSubmit, showRegistrationForm, validationErrors, } = isDemo() ? useGoogleDemo(this) : usePortalGoogleRegistrationForm(this);
|
|
165
165
|
const content = {
|
|
166
166
|
formData: h("slot", { name: "formData" }),
|
|
167
167
|
googleButton: (h("sqm-google-sign-in", { text: this.googleButtonText, onInitComplete: handleGoogleInit })),
|
|
@@ -192,7 +192,7 @@ export class PortalGoogleRegistrationForm {
|
|
|
192
192
|
};
|
|
193
193
|
if (showRegistrationForm.mode === "base") {
|
|
194
194
|
return (h(BaseRegistrationFormView, { states: {
|
|
195
|
-
|
|
195
|
+
validationErrors,
|
|
196
196
|
}, callbacks: { handleEmailSubmit }, content: content }));
|
|
197
197
|
}
|
|
198
198
|
return (h(PortalRegistrationFormView, { states: {
|
|
@@ -874,7 +874,7 @@ function useGoogleDemo(props) {
|
|
|
874
874
|
mode: "base",
|
|
875
875
|
});
|
|
876
876
|
return deepmerge({
|
|
877
|
-
|
|
877
|
+
validationErrors: {},
|
|
878
878
|
handleEmailSubmit: () => setShowRegistrationForm({ mode: "manual" }),
|
|
879
879
|
showRegistrationForm,
|
|
880
880
|
handleGoogleInit: () => setShowRegistrationForm({ mode: "google" }),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useState } from "@saasquatch/universal-hooks";
|
|
2
2
|
import jsonpointer from "jsonpointer";
|
|
3
|
-
import { useRegistrationForm } from "../sqm-portal-registration-form/useRegistrationFormState";
|
|
4
3
|
import { jwtDecode } from "jwt-decode";
|
|
4
|
+
import { useRegistrationForm } from "../sqm-portal-registration-form/useRegistrationFormState";
|
|
5
5
|
export function usePortalGoogleRegistrationForm(props) {
|
|
6
|
-
const [emailValidationError, setEmailValidationError] = useState(null);
|
|
7
6
|
const [registrationFormState, setRegistrationFormState] = useRegistrationForm();
|
|
8
7
|
const [showRegistrationForm, setShowRegistrationForm] = useState({
|
|
9
8
|
mode: "base",
|
|
@@ -11,33 +10,40 @@ export function usePortalGoogleRegistrationForm(props) {
|
|
|
11
10
|
const handleEmailSubmit = async (event) => {
|
|
12
11
|
const formControls = event.target.getFormControls();
|
|
13
12
|
let formData = {};
|
|
14
|
-
let
|
|
13
|
+
let validationErrors = {};
|
|
15
14
|
formControls.forEach((control) => {
|
|
16
15
|
if (!control.name)
|
|
17
16
|
return;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
const key = control.name;
|
|
18
|
+
const value = control.value;
|
|
19
|
+
jsonpointer.set(formData, key, value);
|
|
20
|
+
if (control.required && !value) {
|
|
21
|
+
jsonpointer.set(validationErrors, key, props.requiredFieldErrorMessage);
|
|
22
|
+
}
|
|
24
23
|
if (typeof control.validationError === "function") {
|
|
25
24
|
const validate = control.validationError;
|
|
26
25
|
const validationError = validate({
|
|
27
26
|
control,
|
|
28
|
-
key
|
|
29
|
-
value
|
|
27
|
+
key,
|
|
28
|
+
value,
|
|
30
29
|
});
|
|
31
30
|
if (validationError)
|
|
32
|
-
|
|
31
|
+
jsonpointer.set(validationErrors, key, validationError);
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
|
-
if (
|
|
36
|
-
|
|
34
|
+
if (Object.keys(validationErrors).length) {
|
|
35
|
+
// early return for validation errors
|
|
36
|
+
setRegistrationFormState({
|
|
37
|
+
...registrationFormState,
|
|
38
|
+
loading: false,
|
|
39
|
+
error: "",
|
|
40
|
+
validationErrors,
|
|
41
|
+
});
|
|
37
42
|
return;
|
|
38
43
|
}
|
|
39
44
|
setRegistrationFormState({
|
|
40
45
|
...registrationFormState,
|
|
46
|
+
validationErrors: {},
|
|
41
47
|
initialData: {
|
|
42
48
|
...registrationFormState === null || registrationFormState === void 0 ? void 0 : registrationFormState.initialData,
|
|
43
49
|
...formData,
|
|
@@ -67,8 +73,9 @@ export function usePortalGoogleRegistrationForm(props) {
|
|
|
67
73
|
}
|
|
68
74
|
};
|
|
69
75
|
return {
|
|
76
|
+
registrationFormState,
|
|
70
77
|
showRegistrationForm,
|
|
71
|
-
|
|
78
|
+
validationErrors: registrationFormState.validationErrors,
|
|
72
79
|
handleGoogleInit,
|
|
73
80
|
handleEmailSubmit,
|
|
74
81
|
};
|
|
@@ -133,11 +133,11 @@ export class TaskCard {
|
|
|
133
133
|
disconnectedCallback() { }
|
|
134
134
|
render() {
|
|
135
135
|
const { props } = isDemo()
|
|
136
|
-
? useDemoBigStat(this)
|
|
136
|
+
? useDemoBigStat(getProps(this))
|
|
137
137
|
: useBigStat({ ...getProps(this), programId: this.programId });
|
|
138
138
|
const { value, loading } = props;
|
|
139
139
|
const { states, callbacks } = isDemo()
|
|
140
|
-
? useTaskCardDemo(this)
|
|
140
|
+
? useTaskCardDemo(getProps(this))
|
|
141
141
|
: useTaskCard(this);
|
|
142
142
|
return (h(TaskCardView, { callbacks: callbacks, states: {
|
|
143
143
|
loading,
|
|
@@ -72,7 +72,8 @@ catch (error) {
|
|
|
72
72
|
}
|
|
73
73
|
import { insertCSS } from "../insertcss";
|
|
74
74
|
import { insertFont } from "../insertfont";
|
|
75
|
-
import
|
|
75
|
+
import stylesV1 from "./styles.v1";
|
|
76
|
+
import { parseBrandingConfig } from "./styles.v2";
|
|
76
77
|
const applyStyles = (css, font) => {
|
|
77
78
|
try {
|
|
78
79
|
insertCSS(css);
|
|
@@ -91,5 +92,15 @@ if (getEnvironmentSDK().type === "None") {
|
|
|
91
92
|
applyStyles(styles, font);
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if (window.SquatchBrandingConfig) {
|
|
96
|
+
const { styles, font } = parseBrandingConfig(window.SquatchBrandingConfig);
|
|
97
|
+
applyStyles(styles, font);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
try {
|
|
101
|
+
insertCSS(stylesV1);
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
debug(e);
|
|
105
|
+
}
|
|
106
|
+
}
|