mitre-form-component 2.2.1 → 2.2.3
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/README.md +4 -4
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ interface Product {
|
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
type Environment = "
|
|
8
|
+
type Environment = "staging" | "prod";
|
|
9
9
|
|
|
10
10
|
declare enum ContactPreference {
|
|
11
11
|
Whatsapp = "Whatsapp",
|
|
@@ -18,7 +18,7 @@ interface MitreFormComponentProps {
|
|
|
18
18
|
products: Product[];
|
|
19
19
|
/**
|
|
20
20
|
* Define de qual config interno o componente lê `apiUrl`, `apiToken`,
|
|
21
|
-
* `whatsappPhone` e `chatUrl`. Default `"
|
|
21
|
+
* `whatsappPhone` e `chatUrl`. Default `"staging"`.
|
|
22
22
|
*/
|
|
23
23
|
environment?: Environment;
|
|
24
24
|
/** Default `"form"`. Ver doc/channel-feature.md. */
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface Product {
|
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
type Environment = "
|
|
8
|
+
type Environment = "staging" | "prod";
|
|
9
9
|
|
|
10
10
|
declare enum ContactPreference {
|
|
11
11
|
Whatsapp = "Whatsapp",
|
|
@@ -18,7 +18,7 @@ interface MitreFormComponentProps {
|
|
|
18
18
|
products: Product[];
|
|
19
19
|
/**
|
|
20
20
|
* Define de qual config interno o componente lê `apiUrl`, `apiToken`,
|
|
21
|
-
* `whatsappPhone` e `chatUrl`. Default `"
|
|
21
|
+
* `whatsappPhone` e `chatUrl`. Default `"staging"`.
|
|
22
22
|
*/
|
|
23
23
|
environment?: Environment;
|
|
24
24
|
/** Default `"form"`. Ver doc/channel-feature.md. */
|
package/dist/index.js
CHANGED
|
@@ -1043,8 +1043,8 @@ var PrimaryButton = styled6.button`
|
|
|
1043
1043
|
}
|
|
1044
1044
|
`;
|
|
1045
1045
|
var SecondaryText = styled6.p`
|
|
1046
|
-
|
|
1047
|
-
margin:
|
|
1046
|
+
&&& {
|
|
1047
|
+
margin: 3rem 0 0.5rem !important;
|
|
1048
1048
|
padding: 0 !important;
|
|
1049
1049
|
font-family: ${theme.fonts.primary} !important;
|
|
1050
1050
|
font-size: 0.85rem !important;
|
|
@@ -1431,7 +1431,7 @@ var ProductSelect = forwardRef3(ProductSelectBase);
|
|
|
1431
1431
|
|
|
1432
1432
|
// src/config/environments.ts
|
|
1433
1433
|
var ENVIRONMENTS = {
|
|
1434
|
-
|
|
1434
|
+
staging: {
|
|
1435
1435
|
apiUrl: "https://leads-hml.mitrerealty.com.br/api-leads",
|
|
1436
1436
|
apiToken: "TEFORElOR19NSVRSRTptZlFXZnhvUHdNbWVZY0FidkF0QWJ3Q2RFYWtKckJBOXg5cGNsOTBvS1V0N2ZsU0d4TEtNdEZZd3k0NFlEc0c3",
|
|
1437
1437
|
whatsappPhone: "551148100601",
|
|
@@ -1444,7 +1444,7 @@ var ENVIRONMENTS = {
|
|
|
1444
1444
|
chatUrl: "https://crm.mitrerealty.com.br/wcc/UserLoginSubmit.do"
|
|
1445
1445
|
}
|
|
1446
1446
|
};
|
|
1447
|
-
var resolveEnvironment = (environment = "
|
|
1447
|
+
var resolveEnvironment = (environment = "staging") => {
|
|
1448
1448
|
return ENVIRONMENTS[environment] ?? null;
|
|
1449
1449
|
};
|
|
1450
1450
|
|
|
@@ -1565,7 +1565,7 @@ var schemaWithProduct = yup.object().shape({
|
|
|
1565
1565
|
var schema = yup.object().shape(baseSchema);
|
|
1566
1566
|
var MitreFormComponent = React2.forwardRef(({
|
|
1567
1567
|
products,
|
|
1568
|
-
environment = "
|
|
1568
|
+
environment = "staging",
|
|
1569
1569
|
channel = "form",
|
|
1570
1570
|
showHeader = true,
|
|
1571
1571
|
title = "Atendimento por mensagem",
|
|
@@ -1621,7 +1621,7 @@ var MitreFormComponent = React2.forwardRef(({
|
|
|
1621
1621
|
const env = resolveEnvironment(environment);
|
|
1622
1622
|
const validateEnvironmentConfig = () => {
|
|
1623
1623
|
if (!env) {
|
|
1624
|
-
return `environment='${environment}' n\xE3o \xE9 reconhecido. Use '
|
|
1624
|
+
return `environment='${environment}' n\xE3o \xE9 reconhecido. Use 'staging' ou 'prod'.`;
|
|
1625
1625
|
}
|
|
1626
1626
|
if (!env.apiUrl || !env.apiToken) {
|
|
1627
1627
|
return `Configura\xE7\xE3o interna do environment '${environment}' est\xE1 incompleta (apiUrl/apiToken).`;
|