@bigbinary/neeto-rules-frontend 2.7.19 → 2.7.20

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.
Files changed (33) hide show
  1. package/app/javascript/src/translations/en.json +2 -1
  2. package/dist/.ready +1 -1
  3. package/dist/NeetoRulesBuilder.js +51 -17
  4. package/dist/NeetoRulesBuilder.js.map +1 -1
  5. package/dist/NeetoRulesForm.js +2 -2
  6. package/dist/cjs/NeetoRulesBuilder.js +50 -16
  7. package/dist/cjs/NeetoRulesBuilder.js.map +1 -1
  8. package/dist/cjs/NeetoRulesForm.js +2 -2
  9. package/dist/cjs/index.js +2 -2
  10. package/dist/cjs/v2/NeetoRulesBuilder.js +50 -16
  11. package/dist/cjs/v2/NeetoRulesBuilder.js.map +1 -1
  12. package/dist/cjs/v2/NeetoRulesForm.js +2 -2
  13. package/dist/cjs/v2/index.js +2 -2
  14. package/dist/{index-k-eGkX-R.js → index-BXLCiV70.js} +2 -2
  15. package/dist/{index-k-eGkX-R.js.map → index-BXLCiV70.js.map} +1 -1
  16. package/dist/{index-DwGEK-_1.js → index-DMCgC01M.js} +2 -2
  17. package/dist/{index-DwGEK-_1.js.map → index-DMCgC01M.js.map} +1 -1
  18. package/dist/{index-ogJeZ752.js → index-D_dEe2Gg.js} +2 -2
  19. package/dist/{index-ogJeZ752.js.map → index-D_dEe2Gg.js.map} +1 -1
  20. package/dist/{index-Vt6GY_o0.js → index-hvuc6OIP.js} +2 -2
  21. package/dist/{index-Vt6GY_o0.js.map → index-hvuc6OIP.js.map} +1 -1
  22. package/dist/index.js +2 -2
  23. package/dist/keyboardShortcuts-DXP5YgeG.js +92 -0
  24. package/dist/{keyboardShortcuts-SAk712q8.js.map → keyboardShortcuts-DXP5YgeG.js.map} +1 -1
  25. package/dist/keyboardShortcuts-lX0oq49M.js +96 -0
  26. package/dist/{keyboardShortcuts-DNOhEY8h.js.map → keyboardShortcuts-lX0oq49M.js.map} +1 -1
  27. package/dist/v2/NeetoRulesBuilder.js +51 -17
  28. package/dist/v2/NeetoRulesBuilder.js.map +1 -1
  29. package/dist/v2/NeetoRulesForm.js +2 -2
  30. package/dist/v2/index.js +2 -2
  31. package/package.json +1 -1
  32. package/dist/keyboardShortcuts-DNOhEY8h.js +0 -88
  33. package/dist/keyboardShortcuts-SAk712q8.js +0 -92
@@ -458,7 +458,8 @@
458
458
  },
459
459
  "shortcuts": {
460
460
  "submit": "Submit field",
461
- "cancel": "Cancel"
461
+ "cancel": "Cancel",
462
+ "continue": "Continue"
462
463
  },
463
464
  "helpTexts": {
464
465
  "phoneNumber": "Please enter each number with a + followed by the country code (for example: +918888888888). You can add multiple numbers."
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-08-20T10:44:42.330Z
1
+ Built at 2026-08-24T08:03:50.144Z
@@ -1,8 +1,8 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
3
- import { f as flatten } from './keyboardShortcuts-DNOhEY8h.js';
3
+ import { f as flatten, S as SHORTCUTS } from './keyboardShortcuts-DXP5YgeG.js';
4
4
  import { useShallow } from 'zustand/shallow';
5
- import { useState, createElement, Fragment as Fragment$1, useCallback, useMemo, useRef, useEffect } from 'react';
5
+ import { useState, useRef, useEffect, createElement, Fragment as Fragment$1, useCallback, useMemo } from 'react';
6
6
  import classNames from 'classnames';
7
7
  import { useFormikContext, getIn, useField, Formik, Form as Form$1 } from 'formik';
8
8
  import { isNotEmpty, toLabelAndValue, removeBy, isNot, findBy, noop } from '@bigbinary/neeto-cist';
@@ -11,7 +11,7 @@ import Header from '@bigbinary/neeto-molecules/Header';
11
11
  import Spinner from '@bigbinary/neetoui/Spinner';
12
12
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
13
13
  import { useTranslation } from 'react-i18next';
14
- import { E as EditorAction, o as Panel, r as ErrorCallout, s as SmsFields, M as MIN_DELAY_VALUE, t as MAX_DELAY_VALUE, v as PhoneNumberField, l as formatData, u as usePollRuleName, T as TouchErrors, n as ScrollToErrorField, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE, m as buildPayload } from './index-ogJeZ752.js';
14
+ import { E as EditorAction, o as Panel, r as ErrorCallout, s as SmsFields, M as MIN_DELAY_VALUE, t as MAX_DELAY_VALUE, v as PhoneNumberField, l as formatData, u as usePollRuleName, T as TouchErrors, n as ScrollToErrorField, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE, m as buildPayload } from './index-D_dEe2Gg.js';
15
15
  import { u as useCustomDataStore } from './useCustomDataStore-BtKYtLVc.js';
16
16
  import { u as useUtilityStore } from './useUtilityStore-CCUYS1mS.js';
17
17
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -24,8 +24,8 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
24
24
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
25
25
  import { t } from 'i18next';
26
26
  import * as yup from 'yup';
27
- import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
28
27
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
28
+ import useHotkeys from '@bigbinary/neeto-hotkeys';
29
29
  import Search from '@bigbinary/neeto-icons/Search';
30
30
  import Input from '@bigbinary/neetoui/Input';
31
31
  import Typography from '@bigbinary/neetoui/Typography';
@@ -45,6 +45,7 @@ import MultiEmailInput from '@bigbinary/neetoui/MultiEmailInput';
45
45
  import '@babel/runtime/helpers/typeof';
46
46
  import './useAutomationRulesApi-C9I3wUZ8.js';
47
47
  import '@tanstack/react-query';
48
+ import '@bigbinary/neeto-commons-frontend/react-utils';
48
49
  import 'axios';
49
50
  import './index-9h4B7JZZ.js';
50
51
  import '@bigbinary/neetoui/formik/Radio';
@@ -62,7 +63,6 @@ import '@bigbinary/neetoui/Label';
62
63
  import '@bigbinary/neetoui/formik/MultiEmailInput';
63
64
  import '@bigbinary/neeto-editor/FormikEditor';
64
65
  import '@bigbinary/neeto-icons/Refresh';
65
- import '@bigbinary/neeto-hotkeys';
66
66
  import '@bigbinary/neeto-icons/Check';
67
67
  import 'react-select/creatable';
68
68
  import '@babel/runtime/helpers/toArray';
@@ -256,6 +256,21 @@ var TOKEN_STATE = {
256
256
  };
257
257
  var STATE_CLASS = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TOKEN_STATE.PLACEHOLDER, "mb-placeholder"), TOKEN_STATE.PLACEHOLDER_NEXT, "mb-placeholder mb-placeholder-next"), TOKEN_STATE.DISABLED, "mb-placeholder mb-placeholder-disabled"), TOKEN_STATE.FILLED, "mb-tok"), TOKEN_STATE.MUTED, "mb-tok mb-tok-muted");
258
258
 
259
+ // The flash is a run-once CSS animation, so a repeat submit while it is still
260
+ // applied would not replay it on its own.
261
+ var useReplayFlash = function useReplayFlash(flashSeq) {
262
+ var ref = useRef(null);
263
+ useEffect(function () {
264
+ var _ref$current, _ref$current$getAnima;
265
+ if (!flashSeq) return;
266
+ (_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current$getAnima = _ref$current.getAnimations) === null || _ref$current$getAnima === void 0 || _ref$current$getAnima.call(_ref$current).forEach(function (animation) {
267
+ animation.cancel();
268
+ animation.play();
269
+ });
270
+ }, [flashSeq]);
271
+ return ref;
272
+ };
273
+
259
274
  var _excluded = ["children", "state", "active", "invalid", "onClick", "className", "dataTestid"];
260
275
  function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
261
276
  function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -272,8 +287,10 @@ var Token = function Token(_ref) {
272
287
  dataTestid = _ref.dataTestid,
273
288
  rest = _objectWithoutProperties(_ref, _excluded);
274
289
  var isInteractive = typeof onClick === "function" && state !== TOKEN_STATE.DISABLED;
290
+ var tokenRef = useReplayFlash(invalid);
275
291
  return /*#__PURE__*/jsx("span", _objectSpread$c(_objectSpread$c({
276
292
  "data-testid": dataTestid,
293
+ ref: tokenRef,
277
294
  role: isInteractive ? "button" : undefined,
278
295
  tabIndex: isInteractive ? 0 : undefined,
279
296
  className: classNames(
@@ -1087,15 +1104,17 @@ var DelayRow = function DelayRow(_ref) {
1087
1104
  });
1088
1105
  };
1089
1106
 
1090
- var MetaBlock = withT(function (_ref) {
1091
- var t = _ref.t,
1092
- rule = _ref.rule,
1107
+ var MetaBlock = function MetaBlock(_ref) {
1108
+ var rule = _ref.rule,
1093
1109
  _ref$showName = _ref.showName,
1094
1110
  showName = _ref$showName === void 0 ? true : _ref$showName,
1095
1111
  _ref$isInvalid = _ref.isInvalid,
1096
1112
  isInvalid = _ref$isInvalid === void 0 ? false : _ref$isInvalid,
1097
1113
  handleEditName = _ref.onEditName,
1098
1114
  handleToggleActive = _ref.onToggleActive;
1115
+ var _useTranslation = useTranslation(),
1116
+ t = _useTranslation.t;
1117
+ var nameRef = useReplayFlash(isInvalid);
1099
1118
  return /*#__PURE__*/jsxs("div", {
1100
1119
  className: "mb-meta",
1101
1120
  children: [showName && /*#__PURE__*/jsxs("div", {
@@ -1104,6 +1123,7 @@ var MetaBlock = withT(function (_ref) {
1104
1123
  className: "mb-meta-label",
1105
1124
  children: t("neetoRules.builder.automationName")
1106
1125
  }), /*#__PURE__*/jsxs("div", {
1126
+ ref: nameRef,
1107
1127
  role: handleEditName ? "button" : undefined,
1108
1128
  tabIndex: handleEditName ? 0 : undefined,
1109
1129
  className: classNames("mb-meta-input-wrap", {
@@ -1153,7 +1173,7 @@ var MetaBlock = withT(function (_ref) {
1153
1173
  }), t("neetoRules.builder.activateThisAutomation")]
1154
1174
  })]
1155
1175
  });
1156
- });
1176
+ };
1157
1177
 
1158
1178
  function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1159
1179
  function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -2815,10 +2835,10 @@ var Canvas = function Canvas(_ref) {
2815
2835
  var flatErrors = useMemo(function () {
2816
2836
  return flatten(errors || {});
2817
2837
  }, [errors]);
2818
- var _useState = useState(false),
2838
+ var _useState = useState(0),
2819
2839
  _useState2 = _slicedToArray(_useState, 2),
2820
- flashing = _useState2[0],
2821
- setFlashing = _useState2[1];
2840
+ flashSeq = _useState2[0],
2841
+ setFlashSeq = _useState2[1];
2822
2842
  var lastSubmitCount = useRef(submitCount);
2823
2843
  useEffect(function () {
2824
2844
  if (submitCount <= lastSubmitCount.current) return undefined;
@@ -2832,9 +2852,9 @@ var Canvas = function Canvas(_ref) {
2832
2852
  }))) {
2833
2853
  return undefined;
2834
2854
  }
2835
- setFlashing(true);
2855
+ setFlashSeq(submitCount);
2836
2856
  var timer = setTimeout(function () {
2837
- return setFlashing(false);
2857
+ return setFlashSeq(0);
2838
2858
  }, FLASH_DURATION_MS);
2839
2859
  return function () {
2840
2860
  return clearTimeout(timer);
@@ -2851,11 +2871,10 @@ var Canvas = function Canvas(_ref) {
2851
2871
  });
2852
2872
  });
2853
2873
  };
2854
- var isInvalid = function isInvalid(_ref4) {
2874
+ var matchesInvalid = function matchesInvalid(_ref4) {
2855
2875
  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;
2856
2876
  var type = _ref4.type,
2857
2877
  index = _ref4.index;
2858
- if (!flashing) return false;
2859
2878
  var conditionMeta = "".concat(fieldKeys.conditions, ".value.").concat(index, ".metadata");
2860
2879
  var actionMeta = "".concat(fieldKeys.actions, ".value.").concat(index, ".metadata");
2861
2880
  // eslint-disable-next-line security/detect-object-injection
@@ -2946,6 +2965,12 @@ var Canvas = function Canvas(_ref) {
2946
2965
  return false;
2947
2966
  }
2948
2967
  };
2968
+
2969
+ // Returns the submit generation, not a boolean, so consumers can replay the
2970
+ // flash animation when the same token is still invalid on a repeat submit.
2971
+ var isInvalid = function isInvalid(args) {
2972
+ return flashSeq && matchesInvalid(args) ? flashSeq : 0;
2973
+ };
2949
2974
  var closePaneIfTargeting = function closePaneIfTargeting(_ref5) {
2950
2975
  var anchors = _ref5.anchors,
2951
2976
  index = _ref5.index;
@@ -3562,6 +3587,10 @@ var ConfigPane = function ConfigPane(_ref) {
3562
3587
  return _ref2.apply(this, arguments);
3563
3588
  };
3564
3589
  }();
3590
+ useHotkeys(SHORTCUTS["continue"].sequence, handleContinue, {
3591
+ enabled: shouldAdvanceToRecipient,
3592
+ mode: "global"
3593
+ });
3565
3594
  return /*#__PURE__*/jsxs(Fragment, {
3566
3595
  children: [/*#__PURE__*/jsx(Panel.Header, {
3567
3596
  children: /*#__PURE__*/jsxs("div", {
@@ -4059,6 +4088,11 @@ var OptionsPane = function OptionsPane(_ref) {
4059
4088
  data: target.data
4060
4089
  });else closePane();
4061
4090
  };
4091
+ var canContinue = cascade && selectedValues.some(Boolean);
4092
+ useHotkeys(SHORTCUTS["continue"].sequence, handleContinue, {
4093
+ enabled: canContinue,
4094
+ mode: "global"
4095
+ });
4062
4096
  var optionLabel = function optionLabel(option) {
4063
4097
  var Icon = option.icon;
4064
4098
  if (!Icon && !option.disabledReason) return option.label;
@@ -4173,7 +4207,7 @@ var OptionsPane = function OptionsPane(_ref) {
4173
4207
  children: [renderBody(), belowContent]
4174
4208
  }), cascade && /*#__PURE__*/jsx(Panel.Footer, {
4175
4209
  children: /*#__PURE__*/jsx(Button, {
4176
- disabled: !selectedValues.some(Boolean),
4210
+ disabled: !canContinue,
4177
4211
  label: t("neetoRules.buttons.continue"),
4178
4212
  size: "large",
4179
4213
  onClick: handleContinue