@bigbinary/neeto-rules-frontend 2.7.9 → 2.7.11
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 +1 -1
- package/dist/NeetoRulesBuilder.js +2 -2
- package/dist/NeetoRulesForm.js +2 -2
- package/dist/cjs/NeetoRulesBuilder.js +2 -2
- package/dist/cjs/NeetoRulesForm.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/v2/NeetoRules.js +2 -2
- package/dist/cjs/v2/NeetoRules.js.map +1 -1
- package/dist/cjs/v2/NeetoRulesBuilder.js +2 -2
- package/dist/cjs/v2/NeetoRulesForm.js +2 -2
- package/dist/cjs/v2/index.js +2 -2
- package/dist/{index-Co-qUEtS.js → index-CqiiEJkf.js} +2 -2
- package/dist/{index-Co-qUEtS.js.map → index-CqiiEJkf.js.map} +1 -1
- package/dist/{index-BHLJ3lzS.js → index-CqnO-IZF.js} +53 -16
- package/dist/index-CqnO-IZF.js.map +1 -0
- package/dist/{index-CtB-Do-N.js → index-DOW_ZlOp.js} +54 -17
- package/dist/index-DOW_ZlOp.js.map +1 -0
- package/dist/{index-C9u2JDEa.js → index-DZzMQVUu.js} +2 -2
- package/dist/{index-C9u2JDEa.js.map → index-DZzMQVUu.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/keyboardShortcuts-5radhjgX.js +92 -0
- package/dist/{keyboardShortcuts-Dg7lUOmj.js.map → keyboardShortcuts-5radhjgX.js.map} +1 -1
- package/dist/keyboardShortcuts-Ow9vI9My.js +88 -0
- package/dist/{keyboardShortcuts-DcvmDX_K.js.map → keyboardShortcuts-Ow9vI9My.js.map} +1 -1
- package/dist/v2/NeetoRules.js +2 -2
- package/dist/v2/NeetoRules.js.map +1 -1
- package/dist/v2/NeetoRulesBuilder.js +2 -2
- package/dist/v2/NeetoRulesForm.js +2 -2
- package/dist/v2/index.js +2 -2
- package/package.json +14 -14
- package/dist/index-BHLJ3lzS.js.map +0 -1
- package/dist/index-CtB-Do-N.js.map +0 -1
- package/dist/keyboardShortcuts-DcvmDX_K.js +0 -88
- package/dist/keyboardShortcuts-Dg7lUOmj.js +0 -92
|
@@ -6,7 +6,7 @@ import _typeof from '@babel/runtime/helpers/typeof';
|
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
7
7
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
8
8
|
import { b as useUpdateAutomationRule, e as useFetchNameGenerationStatus } from './useAutomationRulesApi-C9I3wUZ8.js';
|
|
9
|
-
import { u as useOnClickOutside, S as SHORTCUTS, f as flatten } from './keyboardShortcuts-
|
|
9
|
+
import { u as useOnClickOutside, S as SHORTCUTS, f as flatten } from './keyboardShortcuts-Ow9vI9My.js';
|
|
10
10
|
import { toLower, identity, pluck, isEmpty, mergeDeepLeft, isNotNil, whereAny, reject, equals, unless, path, omit, useWith, split, when, is, trim, eqBy, F, values, isNil, without, append, pipe, filter, uniq, join, map, assoc, mergeLeft, includes, test } from 'ramda';
|
|
11
11
|
import { t } from 'i18next';
|
|
12
12
|
import * as yup from 'yup';
|
|
@@ -14,7 +14,7 @@ import { useShallow } from 'zustand/shallow';
|
|
|
14
14
|
import { Button, Callout, Typography, Input as Input$1, Label, Select, DatePicker, Checkbox, Badge, RadioGroup as RadioGroup$1, TimePicker } from '@bigbinary/neeto-atoms';
|
|
15
15
|
import { RadioGroup, Textarea, Input as Input$2, Switch, MultiEmailInput, Select as Select$1 } from '@bigbinary/neeto-atoms/formik';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
|
-
import { PanelRightClose, Search, Trash2, CircleHelp, RefreshCw, Check, X, Plus, ChevronLeft } from 'lucide-react';
|
|
17
|
+
import { PanelRightClose, Search, Trash2, CircleHelp, RefreshCw, Lock, Check, X, Plus, ChevronLeft } from 'lucide-react';
|
|
18
18
|
import { useTranslation, Trans } from 'react-i18next';
|
|
19
19
|
import { a as useActiveField } from './useCustomDataStore-CU3KpyD4.js';
|
|
20
20
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
@@ -86,6 +86,17 @@ var ScrollToErrorField = function ScrollToErrorField(_ref) {
|
|
|
86
86
|
return null;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
var DEFAULT_LONG_TEXT_ROWS = 8;
|
|
90
|
+
|
|
91
|
+
// Atoms puts leading-none on option labels, which suits short options but
|
|
92
|
+
// leaves panel options — full sentences that regularly wrap — with no leading
|
|
93
|
+
// at all on their second line.
|
|
94
|
+
var PANEL_OPTION_LABEL_CLASSES = "[&_label]:leading-normal";
|
|
95
|
+
|
|
96
|
+
// A vertical RadioGroup also defaults to an 8px gap, too tight to scan once the
|
|
97
|
+
// options wrap. Checkbox lists space themselves and only need the label fix.
|
|
98
|
+
var PANEL_RADIO_GROUP_CLASSES = "data-[orientation=vertical]:gap-3 ".concat(PANEL_OPTION_LABEL_CLASSES);
|
|
99
|
+
|
|
89
100
|
var Body = function Body(_ref) {
|
|
90
101
|
var children = _ref.children,
|
|
91
102
|
className = _ref.className;
|
|
@@ -416,8 +427,9 @@ var ActionPanel = function ActionPanel() {
|
|
|
416
427
|
variant: "h5",
|
|
417
428
|
children: [label, "..."]
|
|
418
429
|
}), /*#__PURE__*/jsx(Typography, {
|
|
430
|
+
color: "muted",
|
|
419
431
|
"data-testid": "action-description",
|
|
420
|
-
variant: "
|
|
432
|
+
variant: "body3",
|
|
421
433
|
children: t("neetoRules.form.addActionDescription")
|
|
422
434
|
})]
|
|
423
435
|
})
|
|
@@ -443,6 +455,7 @@ var ActionPanel = function ActionPanel() {
|
|
|
443
455
|
})]
|
|
444
456
|
}), isNotEmpty(searchedOptions) ? /*#__PURE__*/jsx(RadioGroup, {
|
|
445
457
|
ref: ref,
|
|
458
|
+
className: PANEL_RADIO_GROUP_CLASSES,
|
|
446
459
|
name: "".concat(name, ".name"),
|
|
447
460
|
orientation: "vertical",
|
|
448
461
|
value: selectedField === null || selectedField === void 0 ? void 0 : selectedField.value,
|
|
@@ -472,8 +485,6 @@ var ActionPanel = function ActionPanel() {
|
|
|
472
485
|
});
|
|
473
486
|
};
|
|
474
487
|
|
|
475
|
-
var DEFAULT_LONG_TEXT_ROWS = 8;
|
|
476
|
-
|
|
477
488
|
var Target$k = function Target(_ref) {
|
|
478
489
|
var _errors$actions, _touched$actions, _selectedField$separa;
|
|
479
490
|
var index = _ref.index,
|
|
@@ -1395,13 +1406,30 @@ var SelectField$1 = function SelectField(_ref2) {
|
|
|
1395
1406
|
setValue(value !== null && value !== void 0 ? value : null);
|
|
1396
1407
|
setTouched(true);
|
|
1397
1408
|
};
|
|
1409
|
+
var formatOptionLabel = function formatOptionLabel(_ref3) {
|
|
1410
|
+
var label = _ref3.label,
|
|
1411
|
+
isPrivate = _ref3.isPrivate;
|
|
1412
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1413
|
+
className: "flex items-center justify-between gap-2",
|
|
1414
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
1415
|
+
children: label
|
|
1416
|
+
}), isPrivate && /*#__PURE__*/jsx(Lock, {
|
|
1417
|
+
"aria-label": t("neetoRules.slack.private"),
|
|
1418
|
+
className: "text-muted-foreground shrink-0",
|
|
1419
|
+
role: "img",
|
|
1420
|
+
size: 14
|
|
1421
|
+
})]
|
|
1422
|
+
});
|
|
1423
|
+
};
|
|
1398
1424
|
return /*#__PURE__*/jsxs("div", {
|
|
1399
1425
|
className: "flex items-start gap-2",
|
|
1400
|
-
children: [/*#__PURE__*/jsx(Select$1, _objectSpread$c(_objectSpread$c({}, _objectSpread$c({
|
|
1426
|
+
children: [/*#__PURE__*/jsx(Select$1, _objectSpread$c(_objectSpread$c({}, _objectSpread$c(_objectSpread$c({
|
|
1401
1427
|
className: className,
|
|
1402
1428
|
name: name,
|
|
1403
1429
|
required: required
|
|
1404
|
-
}, otherProps)
|
|
1430
|
+
}, otherProps), {}, {
|
|
1431
|
+
formatOptionLabel: formatOptionLabel
|
|
1432
|
+
})), {}, {
|
|
1405
1433
|
innerRef: ref,
|
|
1406
1434
|
label: defaultLabel,
|
|
1407
1435
|
options: dropdownOptions,
|
|
@@ -2053,7 +2081,7 @@ var MultiSelectCheckbox$1 = function MultiSelectCheckbox(_ref2) {
|
|
|
2053
2081
|
};
|
|
2054
2082
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.placeholder) || t("neetoRules.labels.selectValues");
|
|
2055
2083
|
return /*#__PURE__*/jsxs("div", {
|
|
2056
|
-
className: "space-y-3",
|
|
2084
|
+
className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
|
|
2057
2085
|
children: [/*#__PURE__*/jsx(Label, {
|
|
2058
2086
|
required: required,
|
|
2059
2087
|
children: defaultLabel
|
|
@@ -3115,8 +3143,9 @@ var ActionSubItemPanel = function ActionSubItemPanel() {
|
|
|
3115
3143
|
children: header
|
|
3116
3144
|
})]
|
|
3117
3145
|
}), /*#__PURE__*/jsx(Typography, {
|
|
3146
|
+
color: "muted",
|
|
3118
3147
|
"data-testid": "action-sub-item-description",
|
|
3119
|
-
variant: "
|
|
3148
|
+
variant: "body3",
|
|
3120
3149
|
children: t("neetoRules.form.addActionSubItemDescription")
|
|
3121
3150
|
})]
|
|
3122
3151
|
})
|
|
@@ -3499,7 +3528,7 @@ var MultiSelectCheckbox = function MultiSelectCheckbox(_ref2) {
|
|
|
3499
3528
|
};
|
|
3500
3529
|
var defaultLabel = t("neetoRules.labels.selectValues");
|
|
3501
3530
|
return /*#__PURE__*/jsxs("div", {
|
|
3502
|
-
className: "space-y-3",
|
|
3531
|
+
className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
|
|
3503
3532
|
children: [/*#__PURE__*/jsx(Label, {
|
|
3504
3533
|
required: required,
|
|
3505
3534
|
children: defaultLabel
|
|
@@ -3756,6 +3785,7 @@ var RadioField = function RadioField(_ref2) {
|
|
|
3756
3785
|
}), isNotEmpty(searchedOptions) ? /*#__PURE__*/jsx(RadioGroup$1, _objectSpread$4(_objectSpread$4({
|
|
3757
3786
|
ref: ref,
|
|
3758
3787
|
required: required,
|
|
3788
|
+
className: PANEL_RADIO_GROUP_CLASSES,
|
|
3759
3789
|
label: showLabel && t("neetoRules.labels.selectValue"),
|
|
3760
3790
|
orientation: "vertical",
|
|
3761
3791
|
value: selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value,
|
|
@@ -4013,8 +4043,9 @@ var FieldPanel = function FieldPanel() {
|
|
|
4013
4043
|
variant: "h5",
|
|
4014
4044
|
children: [index ? logicalOperatorLabel : conditionLabel, "..."]
|
|
4015
4045
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4046
|
+
color: "muted",
|
|
4016
4047
|
"data-testid": "condition-description",
|
|
4017
|
-
variant: "
|
|
4048
|
+
variant: "body3",
|
|
4018
4049
|
children: t("neetoRules.form.addConditionDescription")
|
|
4019
4050
|
})]
|
|
4020
4051
|
})
|
|
@@ -4257,8 +4288,9 @@ var VerbAndValuePanel = function VerbAndValuePanel() {
|
|
|
4257
4288
|
children: [index ? logicalOperatorLabel : conditionLabel, " ", fieldLabel, "..."]
|
|
4258
4289
|
})]
|
|
4259
4290
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4291
|
+
color: "muted",
|
|
4260
4292
|
"data-testid": "condition-verb-and-value-description",
|
|
4261
|
-
variant: "
|
|
4293
|
+
variant: "body3",
|
|
4262
4294
|
children: t("neetoRules.form.addConditionVerbAndValueDescription")
|
|
4263
4295
|
})]
|
|
4264
4296
|
})
|
|
@@ -4344,7 +4376,8 @@ var DelayPanel = function DelayPanel() {
|
|
|
4344
4376
|
variant: "h5",
|
|
4345
4377
|
children: t("neetoRules.common.addDelay")
|
|
4346
4378
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4347
|
-
|
|
4379
|
+
color: "muted",
|
|
4380
|
+
variant: "body3",
|
|
4348
4381
|
children: t("neetoRules.helpText.addDelay")
|
|
4349
4382
|
})]
|
|
4350
4383
|
})
|
|
@@ -4597,8 +4630,9 @@ var EventsPanel = function EventsPanel() {
|
|
|
4597
4630
|
variant: "h5",
|
|
4598
4631
|
children: [t("neetoRules.common.when"), "..."]
|
|
4599
4632
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4633
|
+
color: "muted",
|
|
4600
4634
|
"data-testid": "event-description",
|
|
4601
|
-
variant: "
|
|
4635
|
+
variant: "body3",
|
|
4602
4636
|
children: t("neetoRules.form.addEventDescription")
|
|
4603
4637
|
})]
|
|
4604
4638
|
})
|
|
@@ -4620,8 +4654,9 @@ var EventsPanel = function EventsPanel() {
|
|
|
4620
4654
|
}
|
|
4621
4655
|
})
|
|
4622
4656
|
}), /*#__PURE__*/jsxs("div", {
|
|
4623
|
-
className: "space-y-3",
|
|
4657
|
+
className: classNames("space-y-3", PANEL_OPTION_LABEL_CLASSES),
|
|
4624
4658
|
children: [isNotEmpty(searchedOptions) ? singleSelect ? /*#__PURE__*/jsx(RadioGroup$1, {
|
|
4659
|
+
className: PANEL_RADIO_GROUP_CLASSES,
|
|
4625
4660
|
orientation: "vertical",
|
|
4626
4661
|
value: (eventNames === null || eventNames === void 0 ? void 0 : eventNames[0]) || "",
|
|
4627
4662
|
onValueChange: handleRadioChange,
|
|
@@ -4756,14 +4791,16 @@ var PerformerPanel = function PerformerPanel() {
|
|
|
4756
4791
|
children: [t("neetoRules.form.actionTriggeredBy"), "..."]
|
|
4757
4792
|
})]
|
|
4758
4793
|
}), /*#__PURE__*/jsx(Typography, {
|
|
4794
|
+
color: "muted",
|
|
4759
4795
|
"data-testid": "performer-description",
|
|
4760
|
-
variant: "
|
|
4796
|
+
variant: "body3",
|
|
4761
4797
|
children: t("neetoRules.form.addPerformerDescription")
|
|
4762
4798
|
})]
|
|
4763
4799
|
})
|
|
4764
4800
|
}), /*#__PURE__*/jsx(Panel.Body, {
|
|
4765
4801
|
children: /*#__PURE__*/jsx(RadioGroup, {
|
|
4766
4802
|
ref: ref,
|
|
4803
|
+
className: PANEL_RADIO_GROUP_CLASSES,
|
|
4767
4804
|
disabled: isMenuDisabled,
|
|
4768
4805
|
name: "".concat(performerName, ".value"),
|
|
4769
4806
|
orientation: "vertical",
|
|
@@ -5334,4 +5371,4 @@ var formatData = function formatData(data) {
|
|
|
5334
5371
|
};
|
|
5335
5372
|
|
|
5336
5373
|
export { ActionSubItem as A, DEFAULT_RULE_ACTION as D, EditorAction as E, FIELDS_WITH_OPTIONS as F, OPERATORS as O, PANEL_TYPES as P, RadioField as R, SelectField as S, TouchErrors as T, ValueField as V, getFieldDetails$1 as a, getSlackChannelErrors as b, getLogicalOperatorOptions as c, getFieldDetails as d, getVerbOptions as e, DEFAULT_DELAY as f, getActionOptions as g, getAllEvents as h, STATUS_KEYS as i, formatData as j, buildPayload as k, ScrollToErrorField as l, Panel as m, getValidationSchema as n, DEFAULT_INITIAL_VALUE as o, ErrorCallout as p, SmsFields as q, PhoneNumberField as r, usePollRuleName as u };
|
|
5337
|
-
//# sourceMappingURL=index-
|
|
5374
|
+
//# sourceMappingURL=index-DOW_ZlOp.js.map
|