@bigbinary/neeto-rules-frontend 0.4.4 → 0.4.5
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/index.cjs.js +13 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1494,7 +1494,8 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
1494
1494
|
};
|
|
1495
1495
|
|
|
1496
1496
|
var EditorAction = function EditorAction(_ref) {
|
|
1497
|
-
var
|
|
1497
|
+
var autoFocus = _ref.autoFocus,
|
|
1498
|
+
name = _ref.name,
|
|
1498
1499
|
_ref$value = _ref.value,
|
|
1499
1500
|
value = _ref$value === void 0 ? "" : _ref$value,
|
|
1500
1501
|
label = _ref.label,
|
|
@@ -1511,10 +1512,10 @@ var EditorAction = function EditorAction(_ref) {
|
|
|
1511
1512
|
setFieldValue(name, editorData);
|
|
1512
1513
|
}, [debouncedValue]);
|
|
1513
1514
|
return /*#__PURE__*/React.createElement(FormikEditor, {
|
|
1515
|
+
autoFocus: autoFocus,
|
|
1514
1516
|
label: label,
|
|
1515
1517
|
name: name,
|
|
1516
1518
|
variables: variables,
|
|
1517
|
-
autoFocus: true,
|
|
1518
1519
|
hideSlashCommands: true,
|
|
1519
1520
|
addons: EDITOR_ADDONS,
|
|
1520
1521
|
className: "w-full",
|
|
@@ -1597,7 +1598,7 @@ var InputField$2 = function InputField(_ref) {
|
|
|
1597
1598
|
label: label,
|
|
1598
1599
|
type: "text"
|
|
1599
1600
|
}, field, {
|
|
1600
|
-
error: meta.error,
|
|
1601
|
+
error: meta.touched ? meta.error : "",
|
|
1601
1602
|
ref: initialFocusRef,
|
|
1602
1603
|
value: text,
|
|
1603
1604
|
onChange: function onChange(e) {
|
|
@@ -1624,12 +1625,14 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
1624
1625
|
showPane = _useState2[0],
|
|
1625
1626
|
setShowPane = _useState2[1];
|
|
1626
1627
|
var initialFocusRef = useRef(null);
|
|
1628
|
+
var _useTranslation = useTranslation(),
|
|
1629
|
+
t = _useTranslation.t;
|
|
1627
1630
|
useOnButtonPressed(initialFocusRef, function () {
|
|
1628
1631
|
return setShowPane(false);
|
|
1629
1632
|
});
|
|
1630
1633
|
var isValid = errors.actions && isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1631
|
-
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t
|
|
1632
|
-
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.emailPlaceholder) || t
|
|
1634
|
+
var separator = (selectedField === null || selectedField === void 0 || (_selectedField$separa = selectedField.separator) === null || _selectedField$separa === void 0 ? void 0 : _selectedField$separa.toLowerCase()) || t("neetoRules.common.as");
|
|
1635
|
+
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.emailPlaceholder) || t("neetoRules.common.email");
|
|
1633
1636
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
|
|
1634
1637
|
className: "neeto-ui-text-gray-700 mt-1",
|
|
1635
1638
|
"data-cy": "action-email-seperator-text",
|
|
@@ -1670,10 +1673,11 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
1670
1673
|
className: "mb-4",
|
|
1671
1674
|
"data-cy": "email-action-subject-text-field",
|
|
1672
1675
|
initialFocusRef: isEmailIdField ? null : initialFocusRef,
|
|
1673
|
-
label: t
|
|
1676
|
+
label: t("neetoRules.labels.subject"),
|
|
1674
1677
|
name: "".concat(name, ".subject")
|
|
1675
1678
|
}), /*#__PURE__*/React.createElement(EditorAction, {
|
|
1676
|
-
|
|
1679
|
+
autoFocus: !isEmailIdField && selectedField.hideSubject,
|
|
1680
|
+
label: t("neetoRules.labels.body"),
|
|
1677
1681
|
name: "".concat(name, ".body"),
|
|
1678
1682
|
value: (_action$metadata = action.metadata) === null || _action$metadata === void 0 ? void 0 : _action$metadata.body,
|
|
1679
1683
|
variables: selectedField === null || selectedField === void 0 ? void 0 : selectedField.variables
|
|
@@ -1681,12 +1685,12 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
1681
1685
|
className: "flex items-center space-x-2"
|
|
1682
1686
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
1683
1687
|
"data-cy": "save-changes-button",
|
|
1684
|
-
label: t
|
|
1688
|
+
label: t("neetoRules.common.saveChange"),
|
|
1685
1689
|
onClick: function onClick() {
|
|
1686
1690
|
return setShowPane(false);
|
|
1687
1691
|
}
|
|
1688
1692
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
1689
|
-
label: t
|
|
1693
|
+
label: t("neetoRules.buttons.cancel"),
|
|
1690
1694
|
style: "text",
|
|
1691
1695
|
onClick: function onClick() {
|
|
1692
1696
|
return setShowPane(false);
|