@bigbinary/neeto-rules-frontend 2.7.0 → 2.7.1

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-10T03:55:08.040Z
1
+ Built at 2026-07-11T22:05:01.887Z
@@ -9,7 +9,7 @@ import { b as useUpdateAutomationRule, c as useCloneAutomationRule, d as useDele
9
9
  import { I as INITIAL_RULES_DATA, R as RulesReorder } from './index-CfUbVR_5.js';
10
10
  import Header$2 from '@bigbinary/neeto-molecules/Header';
11
11
  import Button from '@bigbinary/neetoui/Button';
12
- import { c as createRoutes } from './utils-CfCq6Ltz.js';
12
+ import { c as createRoutes } from './utils-DeqHhpwQ.js';
13
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
14
14
  import { useShallow } from 'zustand/shallow';
15
15
  import FilterBar from '@bigbinary/neeto-filters-frontend/Bar';
@@ -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, n as Panel, q as ErrorCallout, r as SmsFields, s as PhoneNumberField, k as formatData, u as usePollRuleName, T as TouchErrors, m as ScrollToErrorField, o as getValidationSchema, p as DEFAULT_INITIAL_VALUE, l as buildPayload } from './index-B0FTuUOt.js';
14
+ import { E as EditorAction, o as Panel, r as ErrorCallout, s as SmsFields, t 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-qw90tLi9.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';
@@ -28,9 +28,12 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
28
28
  import Search from '@bigbinary/neeto-icons/Search';
29
29
  import Input from '@bigbinary/neetoui/Input';
30
30
  import Typography from '@bigbinary/neetoui/Typography';
31
+ import { dayjs } from '@bigbinary/neeto-commons-frontend/utils';
31
32
  import Checkbox from '@bigbinary/neetoui/Checkbox';
33
+ import DatePicker from '@bigbinary/neetoui/DatePicker';
32
34
  import Radio from '@bigbinary/neetoui/Radio';
33
35
  import Textarea from '@bigbinary/neetoui/Textarea';
36
+ import { D as DATE_FORMAT } from './utils-DeqHhpwQ.js';
34
37
  import Input$1 from '@bigbinary/neetoui/formik/Input';
35
38
  import Select from '@bigbinary/neetoui/formik/Select';
36
39
  import Select$1 from '@bigbinary/neetoui/Select';
@@ -56,10 +59,6 @@ import '@monaco-editor/react';
56
59
  import '@bigbinary/neeto-icons/Help';
57
60
  import '@bigbinary/neeto-molecules/DynamicVariables';
58
61
  import '@bigbinary/neetoui/Label';
59
- import '@bigbinary/neeto-commons-frontend/utils';
60
- import '@bigbinary/neetoui/DatePicker';
61
- import './utils-CfCq6Ltz.js';
62
- import '@bigbinary/neeto-commons-frontend/initializers';
63
62
  import '@bigbinary/neetoui/formik/MultiEmailInput';
64
63
  import '@bigbinary/neeto-editor/FormikEditor';
65
64
  import '@bigbinary/neeto-icons/Refresh';
@@ -71,6 +70,7 @@ import '@bigbinary/neeto-molecules/PhoneNumber';
71
70
  import '@bigbinary/neetoui/Tag';
72
71
  import 'react-select';
73
72
  import './constants-C_bfl8XZ.js';
73
+ import '@bigbinary/neeto-commons-frontend/initializers';
74
74
  import '@bigbinary/neetoui/TimePicker';
75
75
  import '@bigbinary/neeto-editor/utils';
76
76
  import 'zustand';
@@ -3036,6 +3036,25 @@ var Canvas = function Canvas(_ref) {
3036
3036
  });
3037
3037
  };
3038
3038
 
3039
+ var ACTION_CONFIG_TYPES = {
3040
+ emailChannel: "emailChannel",
3041
+ multiSelect: "multiSelect",
3042
+ dropdown: "dropdown",
3043
+ note: "note",
3044
+ textarea: "textarea",
3045
+ number: "number",
3046
+ text: "text",
3047
+ regex: "regex",
3048
+ decimal: "decimal",
3049
+ date: "date"
3050
+ };
3051
+ var CONDITION_VALUE_TYPES = {
3052
+ multiSelect: "multi-select",
3053
+ multiSelectCreate: "multi-select-create",
3054
+ number: "number",
3055
+ email: "email"
3056
+ };
3057
+
3039
3058
  var restoreTokens = function restoreTokens(text) {
3040
3059
  return text ? text.replace(/\[\[/g, "{{").replace(/\]\]/g, "}}") : text;
3041
3060
  };
@@ -3085,7 +3104,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3085
3104
  className: "mb-pane-empty",
3086
3105
  children: t("neetoRules.builder.noMatches")
3087
3106
  });
3088
- if (type === "emailChannel") {
3107
+ if (type === ACTION_CONFIG_TYPES.emailChannel) {
3089
3108
  var _getIn, _action$metadata;
3090
3109
  var subjectPath = "".concat(name, ".subject");
3091
3110
  var bodyPath = "".concat(name, ".body");
@@ -3114,7 +3133,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3114
3133
  }), hintBlock]
3115
3134
  });
3116
3135
  }
3117
- if (type === "multiSelect") {
3136
+ if (type === ACTION_CONFIG_TYPES.multiSelect) {
3118
3137
  if (isEmpty(options)) return noOptionsMessage();
3119
3138
  var current = getIn(values, valuePath) || [];
3120
3139
  var filtered = filterOptions(options);
@@ -3139,7 +3158,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3139
3158
  })]
3140
3159
  });
3141
3160
  }
3142
- if (type === "dropdown") {
3161
+ if (type === ACTION_CONFIG_TYPES.dropdown) {
3143
3162
  if (isEmpty(options)) return noOptionsMessage();
3144
3163
  var _current = getIn(values, valuePath);
3145
3164
  var _filtered = filterOptions(options);
@@ -3165,7 +3184,7 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3165
3184
  })
3166
3185
  });
3167
3186
  }
3168
- if (type === "note") {
3187
+ if (type === ACTION_CONFIG_TYPES.note) {
3169
3188
  var _action$metadata2;
3170
3189
  return /*#__PURE__*/jsxs("div", {
3171
3190
  className: "flex flex-col gap-2",
@@ -3179,9 +3198,9 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3179
3198
  }), hintBlock]
3180
3199
  });
3181
3200
  }
3182
- if (type === "textarea" || type === "number") {
3201
+ if (type === ACTION_CONFIG_TYPES.textarea || type === ACTION_CONFIG_TYPES.number) {
3183
3202
  var _getIn2, _getIn3;
3184
- return type === "number" ? /*#__PURE__*/jsx(Input, {
3203
+ return type === ACTION_CONFIG_TYPES.number ? /*#__PURE__*/jsx(Input, {
3185
3204
  required: true,
3186
3205
  error: fieldError(valuePath),
3187
3206
  label: t("neetoRules.builder.config.value"),
@@ -3209,6 +3228,46 @@ var ActionConfigFields = function ActionConfigFields(_ref) {
3209
3228
  }
3210
3229
  });
3211
3230
  }
3231
+ if (type === ACTION_CONFIG_TYPES.text || type === ACTION_CONFIG_TYPES.regex || type === ACTION_CONFIG_TYPES.decimal) {
3232
+ var _getIn4;
3233
+ return /*#__PURE__*/jsxs("div", {
3234
+ className: "flex flex-col gap-2",
3235
+ children: [/*#__PURE__*/jsx(Input, {
3236
+ required: true,
3237
+ error: fieldError(valuePath),
3238
+ label: t("neetoRules.builder.config.value"),
3239
+ placeholder: option === null || option === void 0 ? void 0 : option.valuePlaceholder,
3240
+ size: "large",
3241
+ value: (_getIn4 = getIn(values, valuePath)) !== null && _getIn4 !== void 0 ? _getIn4 : "",
3242
+ onBlur: function onBlur() {
3243
+ return setFieldTouched(valuePath, true);
3244
+ },
3245
+ onChange: function onChange(event) {
3246
+ return setFieldValue(valuePath, event.target.value);
3247
+ }
3248
+ }), hintBlock]
3249
+ });
3250
+ }
3251
+ if (type === ACTION_CONFIG_TYPES.date) {
3252
+ return /*#__PURE__*/jsxs("div", {
3253
+ className: "flex flex-col gap-2",
3254
+ children: [/*#__PURE__*/jsx(DatePicker, {
3255
+ required: true,
3256
+ error: fieldError(valuePath),
3257
+ label: t("neetoRules.builder.config.value"),
3258
+ type: "date",
3259
+ value: getIn(values, valuePath) || "",
3260
+ onBlur: function onBlur() {
3261
+ return setFieldTouched(valuePath, true);
3262
+ },
3263
+ onChange: function onChange(date) {
3264
+ return setFieldValue(valuePath,
3265
+ // eslint-disable-next-line @bigbinary/neeto/use-standard-date-time-formats
3266
+ date ? dayjs(date).format(DATE_FORMAT) : "");
3267
+ }
3268
+ }), hintBlock]
3269
+ });
3270
+ }
3212
3271
  return /*#__PURE__*/jsx(Typography, {
3213
3272
  style: "body2",
3214
3273
  children: t("neetoRules.builder.noConfig")
@@ -4188,7 +4247,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
4188
4247
  className: "mb-pane-empty",
4189
4248
  children: t("neetoRules.builder.noMatches")
4190
4249
  });
4191
- if (type === "multi-select" && isNotEmpty(enumOptions)) {
4250
+ if (type === CONDITION_VALUE_TYPES.multiSelect && isNotEmpty(enumOptions)) {
4192
4251
  var current = getIn(values, valuesPath) || [];
4193
4252
  var filtered = filterOptions(enumOptions);
4194
4253
  if (term && isEmpty(filtered)) return noMatches;
@@ -4212,7 +4271,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
4212
4271
  })]
4213
4272
  });
4214
4273
  }
4215
- if (type === "multi-select") {
4274
+ if (type === CONDITION_VALUE_TYPES.multiSelect) {
4216
4275
  return /*#__PURE__*/jsx(Typography, {
4217
4276
  className: "neeto-ui-text-gray-500",
4218
4277
  style: "body2",
@@ -4221,7 +4280,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
4221
4280
  }) : t("neetoRules.builder.config.noOptions")
4222
4281
  });
4223
4282
  }
4224
- if (type === "multi-select-create") {
4283
+ if (type === CONDITION_VALUE_TYPES.multiSelectCreate) {
4225
4284
  var _current = getIn(values, valuesPath) || [];
4226
4285
  return /*#__PURE__*/jsx(Select$1, {
4227
4286
  autoFocus: true,
@@ -4263,7 +4322,7 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
4263
4322
  })
4264
4323
  });
4265
4324
  }
4266
- if (valueType === "number") {
4325
+ if (valueType === CONDITION_VALUE_TYPES.number) {
4267
4326
  var _getIn;
4268
4327
  return /*#__PURE__*/jsx(Input, {
4269
4328
  autoFocus: true,
@@ -4287,8 +4346,8 @@ var ConditionValueFields = function ConditionValueFields(_ref) {
4287
4346
  label: t("neetoRules.common.value"),
4288
4347
  name: valuePath,
4289
4348
  size: "large",
4290
- type: valueType === "email" ? "email" : "text",
4291
- placeholder: (field === null || field === void 0 ? void 0 : field.placeholder) || (valueType === "email" ? t("neetoRules.builder.config.exampleEmail") : undefined)
4349
+ type: valueType === CONDITION_VALUE_TYPES.email ? "email" : "text",
4350
+ placeholder: (field === null || field === void 0 ? void 0 : field.placeholder) || (valueType === CONDITION_VALUE_TYPES.email ? t("neetoRules.builder.config.exampleEmail") : undefined)
4292
4351
  });
4293
4352
  };
4294
4353