@bigbinary/neeto-rules-frontend 2.7.4 → 2.7.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/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-07-
|
|
1
|
+
Built at 2026-07-21T23:50:34.710Z
|
|
@@ -199,6 +199,11 @@ var CONFIG_FOCUSABLE_SELECTOR = 'input:not([type="radio"]):not([type="checkbox"]
|
|
|
199
199
|
var SMS_TYPES = ["sms", "smsToNumbers"];
|
|
200
200
|
var RECIPIENT_FOCUSABLE_SELECTOR = 'input, textarea, [contenteditable="true"]';
|
|
201
201
|
var SMS_TO_NUMBERS = "smsToNumbers";
|
|
202
|
+
var RECIPIENT_STORAGE_FIELDS = {
|
|
203
|
+
emails: "emails",
|
|
204
|
+
value: "value",
|
|
205
|
+
phoneNumbers: "phoneNumbers"
|
|
206
|
+
};
|
|
202
207
|
var SWAP_CHANNEL_ORDER = ["email", "sms", "slack", "webhook", "calendar_invite"];
|
|
203
208
|
var DEFAULT_DELAY_UNITS = TIME_UNITS;
|
|
204
209
|
|
|
@@ -580,6 +585,9 @@ var normalizeSchema = function normalizeSchema() {
|
|
|
580
585
|
var joinTypeFor = function joinTypeFor(mode) {
|
|
581
586
|
return mode === CONDITION_MODE.OR ? JOIN_TYPE.or : JOIN_TYPE.and;
|
|
582
587
|
};
|
|
588
|
+
var recipientStorageField = function recipientStorageField(field) {
|
|
589
|
+
return field === RECIPIENT_STORAGE_FIELDS.emails ? RECIPIENT_STORAGE_FIELDS.emails : RECIPIENT_STORAGE_FIELDS.value;
|
|
590
|
+
};
|
|
583
591
|
var modeFromJoinType = function modeFromJoinType(joinType) {
|
|
584
592
|
return joinType === JOIN_TYPE.or ? CONDITION_MODE.OR : CONDITION_MODE.AND;
|
|
585
593
|
};
|
|
@@ -2757,7 +2765,7 @@ var Canvas = function Canvas(_ref) {
|
|
|
2757
2765
|
});
|
|
2758
2766
|
};
|
|
2759
2767
|
var isInvalid = function isInvalid(_ref4) {
|
|
2760
|
-
var _schema$actions, _schema$actions$actio, _schema$actions2, _schema$actions2$rend, _schema$actions3, _schema$actions3$rend, _schema$actions4, _schema$actions4$opti, _schema$actions5, _schema$actions5$opti;
|
|
2768
|
+
var _schema$actions, _schema$actions$actio, _schema$actions2, _schema$actions2$rend, _schema$actions3, _schema$actions3$rend, _schema$actions4, _schema$actions4$opti, _schema$actions5, _schema$actions5$opti, _schema$actions6, _schema$actions7;
|
|
2761
2769
|
var type = _ref4.type,
|
|
2762
2770
|
index = _ref4.index;
|
|
2763
2771
|
if (!flashing) return false;
|
|
@@ -2778,7 +2786,13 @@ var Canvas = function Canvas(_ref) {
|
|
|
2778
2786
|
action: actionItem
|
|
2779
2787
|
}));
|
|
2780
2788
|
var flatOption = ((_schema$actions4 = schema.actions) === null || _schema$actions4 === void 0 || (_schema$actions4$opti = _schema$actions4.optionForName) === null || _schema$actions4$opti === void 0 ? void 0 : _schema$actions4$opti.call(_schema$actions4, actionItem.name)) || ((_schema$actions5 = schema.actions) === null || _schema$actions5 === void 0 || (_schema$actions5$opti = _schema$actions5.optionForChannel) === null || _schema$actions5$opti === void 0 ? void 0 : _schema$actions5$opti.call(_schema$actions5, channel));
|
|
2781
|
-
var
|
|
2789
|
+
var recipientConfig = [].concat(_toConsumableArray((((_schema$actions6 = schema.actions) === null || _schema$actions6 === void 0 ? void 0 : _schema$actions6.options) || []).flatMap(function (option) {
|
|
2790
|
+
return option.recipients || [];
|
|
2791
|
+
})), _toConsumableArray(((_schema$actions7 = schema.actions) === null || _schema$actions7 === void 0 ? void 0 : _schema$actions7.recipients) || [])).find(function (item) {
|
|
2792
|
+
var _item$value;
|
|
2793
|
+
return ((_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.id) === actionItem.recipient;
|
|
2794
|
+
});
|
|
2795
|
+
var recipientFields = [].concat(_toConsumableArray(hasRecipientEditor || hasRecipientField ? [RECIPIENT_STORAGE_FIELDS.emails] : []), _toConsumableArray(recipientConfig !== null && recipientConfig !== void 0 && recipientConfig.field ? [recipientStorageField(recipientConfig.field)] : []), _toConsumableArray((flatOption === null || flatOption === void 0 ? void 0 : flatOption.type) === SMS_TO_NUMBERS ? [RECIPIENT_STORAGE_FIELDS.phoneNumbers] : []));
|
|
2782
2796
|
switch (type) {
|
|
2783
2797
|
case BUILDER_ANCHORS.TRIGGER_ACTOR:
|
|
2784
2798
|
{
|
|
@@ -2808,7 +2822,9 @@ var Canvas = function Canvas(_ref) {
|
|
|
2808
2822
|
exclude: recipientFields
|
|
2809
2823
|
});
|
|
2810
2824
|
case BUILDER_ANCHORS.ACTION_RECIPIENT:
|
|
2811
|
-
return
|
|
2825
|
+
return hasErrorAt({
|
|
2826
|
+
prefix: "".concat(fieldKeys.actions, ".value.").concat(index, ".name")
|
|
2827
|
+
}) || recipientFields.some(function (field) {
|
|
2812
2828
|
return hasErrorAt({
|
|
2813
2829
|
prefix: "".concat(actionMeta, ".").concat(field)
|
|
2814
2830
|
});
|
|
@@ -3110,7 +3126,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
|
|
|
3110
3126
|
var bodyPath = "".concat(name, ".body");
|
|
3111
3127
|
return /*#__PURE__*/jsxs("div", {
|
|
3112
3128
|
className: "flex flex-col gap-4",
|
|
3113
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
3129
|
+
children: [!(option !== null && option !== void 0 && option.hideSubject) && /*#__PURE__*/jsx(Input, {
|
|
3114
3130
|
required: true,
|
|
3115
3131
|
error: fieldError(subjectPath),
|
|
3116
3132
|
label: t("neetoRules.builder.config.subject"),
|
|
@@ -3429,7 +3445,7 @@ var ConfigPane = function ConfigPane(_ref) {
|
|
|
3429
3445
|
while (1) switch (_context.n) {
|
|
3430
3446
|
case 0:
|
|
3431
3447
|
_context.n = 1;
|
|
3432
|
-
return validate([
|
|
3448
|
+
return validate([RECIPIENT_STORAGE_FIELDS.emails]);
|
|
3433
3449
|
case 1:
|
|
3434
3450
|
if (_context.v) {
|
|
3435
3451
|
_context.n = 2;
|
|
@@ -4062,8 +4078,8 @@ var RecipientField = function RecipientField(_ref) {
|
|
|
4062
4078
|
var fieldError = function fieldError(path) {
|
|
4063
4079
|
return getIn(touched, path) && getIn(errors, path);
|
|
4064
4080
|
};
|
|
4065
|
-
if (field ===
|
|
4066
|
-
var _path = "".concat(name, ".
|
|
4081
|
+
if (field === RECIPIENT_STORAGE_FIELDS.emails) {
|
|
4082
|
+
var _path = "".concat(name, ".").concat(RECIPIENT_STORAGE_FIELDS.emails);
|
|
4067
4083
|
var _current = getIn(values, _path) || [];
|
|
4068
4084
|
return /*#__PURE__*/jsx(MultiEmailInput, {
|
|
4069
4085
|
required: true,
|
|
@@ -4086,7 +4102,7 @@ var RecipientField = function RecipientField(_ref) {
|
|
|
4086
4102
|
}
|
|
4087
4103
|
});
|
|
4088
4104
|
}
|
|
4089
|
-
var path = "".concat(name, ".
|
|
4105
|
+
var path = "".concat(name, ".").concat(RECIPIENT_STORAGE_FIELDS.value);
|
|
4090
4106
|
var current = getIn(values, path);
|
|
4091
4107
|
var options = normalizeOptions(dropdownOptions);
|
|
4092
4108
|
return /*#__PURE__*/jsx(Select$1, {
|
|
@@ -4132,7 +4148,7 @@ var RecipientPane = function RecipientPane(_ref) {
|
|
|
4132
4148
|
});
|
|
4133
4149
|
var flatOption = ((_schema$actions4 = schema.actions) === null || _schema$actions4 === void 0 || (_schema$actions4$opti = _schema$actions4.optionForName) === null || _schema$actions4$opti === void 0 ? void 0 : _schema$actions4$opti.call(_schema$actions4, action.name)) || ((_schema$actions5 = schema.actions) === null || _schema$actions5 === void 0 || (_schema$actions5$opti = _schema$actions5.optionForChannel) === null || _schema$actions5$opti === void 0 ? void 0 : _schema$actions5$opti.call(_schema$actions5, channel));
|
|
4134
4150
|
var isSmsToNumbers = (flatOption === null || flatOption === void 0 ? void 0 : flatOption.type) === SMS_TO_NUMBERS;
|
|
4135
|
-
var recipientFieldPath = isSmsToNumbers ? "".concat(name, ".
|
|
4151
|
+
var recipientFieldPath = isSmsToNumbers ? "".concat(name, ".").concat(RECIPIENT_STORAGE_FIELDS.phoneNumbers) : "".concat(name, ".").concat(RECIPIENT_STORAGE_FIELDS.emails);
|
|
4136
4152
|
usePaneValidation(recipientFieldPath);
|
|
4137
4153
|
useEffect(function () {
|
|
4138
4154
|
var _bodyRef$current;
|
|
@@ -4163,7 +4179,7 @@ var RecipientPane = function RecipientPane(_ref) {
|
|
|
4163
4179
|
action: action
|
|
4164
4180
|
})) !== null && _schema$actions$rende !== void 0 ? _schema$actions$rende : builtInRecipientField;
|
|
4165
4181
|
var phoneField = isSmsToNumbers ? /*#__PURE__*/jsx(PhoneNumberField, {
|
|
4166
|
-
name: "".concat(name, ".
|
|
4182
|
+
name: "".concat(name, ".").concat(RECIPIENT_STORAGE_FIELDS.phoneNumbers),
|
|
4167
4183
|
phoneNumbers: (_action$metadata = action.metadata) === null || _action$metadata === void 0 ? void 0 : _action$metadata.phoneNumbers
|
|
4168
4184
|
}) : null;
|
|
4169
4185
|
var belowField = phoneField || recipientField;
|