@bigbinary/neeto-rules-frontend 2.8.8-beta1 → 2.8.9-beta1

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.
@@ -70,6 +70,7 @@
70
70
  "addTrigger": "Add a trigger",
71
71
  "whenEllipsis": "When…",
72
72
  "triggerSubtitleMulti": "Pick one or more triggers. The automation runs when any of them happens.",
73
+ "triggerGroupDisabled": "This trigger can't be combined with the ones already selected.",
73
74
  "triggerSubtitleReplace": "Pick a different trigger for this row.",
74
75
  "triggerSubtitleAdd": "Pick what should set this automation in motion.",
75
76
  "actorTitle": "Triggered by...",
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-10-26T14:45:05.161Z
1
+ Built at 2026-10-27T16:25:58.463Z
@@ -2255,11 +2255,23 @@ var triggerValue = function triggerValue(option) {
2255
2255
  var _ref, _option$eventValue;
2256
2256
  return (_ref = (_option$eventValue = option.eventValue) !== null && _option$eventValue !== void 0 ? _option$eventValue : option.value) !== null && _ref !== void 0 ? _ref : option.id;
2257
2257
  };
2258
- var stepAt = function stepAt(_ref2) {
2258
+
2259
+ // Triggers from different groups cannot be combined in one rule.
2260
+ var activeTriggerGroup = function activeTriggerGroup(_ref2) {
2261
+ var _schema$triggers;
2259
2262
  var schema = _ref2.schema,
2260
- rule = _ref2.rule,
2261
- index = _ref2.index,
2262
- stepKey = _ref2.stepKey;
2263
+ rule = _ref2.rule;
2264
+ var names = ramda.pluck("name", rule.triggers);
2265
+ var selected = (((_schema$triggers = schema.triggers) === null || _schema$triggers === void 0 ? void 0 : _schema$triggers.options) || []).find(function (option) {
2266
+ return option.group && names.includes(triggerValue(option));
2267
+ });
2268
+ return selected === null || selected === void 0 ? void 0 : selected.group;
2269
+ };
2270
+ var stepAt = function stepAt(_ref3) {
2271
+ var schema = _ref3.schema,
2272
+ rule = _ref3.rule,
2273
+ index = _ref3.index,
2274
+ stepKey = _ref3.stepKey;
2263
2275
  return actionStepsOf({
2264
2276
  schema: schema,
2265
2277
  action: actionAt({
@@ -2273,11 +2285,11 @@ var stepAt = function stepAt(_ref2) {
2273
2285
 
2274
2286
  // Panes hand off in sentence order — config, recipient, then each host step —
2275
2287
  // so every "what comes next" question resolves through this one list.
2276
- var stepTargetAfter = function stepTargetAfter(_ref3) {
2277
- var schema = _ref3.schema,
2278
- rule = _ref3.rule,
2279
- index = _ref3.index,
2280
- stepKey = _ref3.stepKey;
2288
+ var stepTargetAfter = function stepTargetAfter(_ref4) {
2289
+ var schema = _ref4.schema,
2290
+ rule = _ref4.rule,
2291
+ index = _ref4.index,
2292
+ stepKey = _ref4.stepKey;
2281
2293
  var steps = actionStepsOf({
2282
2294
  schema: schema,
2283
2295
  action: actionAt({
@@ -2326,9 +2338,9 @@ var groupByCategory = function groupByCategory(options) {
2326
2338
  });
2327
2339
  return groups;
2328
2340
  };
2329
- var conditionAt = function conditionAt(_ref4) {
2330
- var rule = _ref4.rule,
2331
- index = _ref4.index;
2341
+ var conditionAt = function conditionAt(_ref5) {
2342
+ var rule = _ref5.rule,
2343
+ index = _ref5.index;
2332
2344
  return (
2333
2345
  // eslint-disable-next-line security/detect-object-injection
2334
2346
  rule.conditions[index] || {}
@@ -2336,63 +2348,63 @@ var conditionAt = function conditionAt(_ref4) {
2336
2348
  };
2337
2349
 
2338
2350
  // eslint-disable-next-line security/detect-object-injection
2339
- var actionAt = function actionAt(_ref5) {
2340
- var rule = _ref5.rule,
2341
- index = _ref5.index;
2351
+ var actionAt = function actionAt(_ref6) {
2352
+ var rule = _ref6.rule,
2353
+ index = _ref6.index;
2342
2354
  return rule.actions[index] || {};
2343
2355
  };
2344
2356
 
2345
2357
  // eslint-disable-next-line security/detect-object-injection
2346
- var scopeItemAt = function scopeItemAt(_ref6) {
2358
+ var scopeItemAt = function scopeItemAt(_ref7) {
2347
2359
  var _rule$scope;
2348
- var rule = _ref6.rule,
2349
- index = _ref6.index;
2360
+ var rule = _ref7.rule,
2361
+ index = _ref7.index;
2350
2362
  return ((_rule$scope = rule.scope) === null || _rule$scope === void 0 ? void 0 : _rule$scope[index]) || {};
2351
2363
  };
2352
2364
  var scopeItemLabel = function scopeItemLabel(item) {
2353
2365
  return (item === null || item === void 0 ? void 0 : item.label) || (item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.value) || String(item !== null && item !== void 0 ? item : "");
2354
2366
  };
2355
- var findField = function findField(_ref7) {
2367
+ var findField = function findField(_ref8) {
2356
2368
  var _schema$conditions;
2357
- var schema = _ref7.schema,
2358
- value = _ref7.value;
2369
+ var schema = _ref8.schema,
2370
+ value = _ref8.value;
2359
2371
  return (((_schema$conditions = schema.conditions) === null || _schema$conditions === void 0 ? void 0 : _schema$conditions.fields) || []).find(function (field) {
2360
2372
  return optionValue(field) === value;
2361
2373
  });
2362
2374
  };
2363
- var findActionOption = function findActionOption(_ref8) {
2375
+ var findActionOption = function findActionOption(_ref9) {
2364
2376
  var _schema$actions;
2365
- var schema = _ref8.schema,
2366
- name = _ref8.name;
2377
+ var schema = _ref9.schema,
2378
+ name = _ref9.name;
2367
2379
  return (((_schema$actions = schema.actions) === null || _schema$actions === void 0 ? void 0 : _schema$actions.options) || []).find(function (option) {
2368
2380
  return optionValue(option) === name;
2369
2381
  });
2370
2382
  };
2371
- var channelOf = function channelOf(_ref9) {
2383
+ var channelOf = function channelOf(_ref0) {
2372
2384
  var _schema$actions2, _schema$actions2$acti;
2373
- var schema = _ref9.schema,
2374
- action = _ref9.action;
2385
+ var schema = _ref0.schema,
2386
+ action = _ref0.action;
2375
2387
  return (action === null || action === void 0 ? void 0 : action.channel) || ((_schema$actions2 = schema.actions) === null || _schema$actions2 === void 0 || (_schema$actions2$acti = _schema$actions2.actionForName) === null || _schema$actions2$acti === void 0 || (_schema$actions2$acti = _schema$actions2$acti.call(_schema$actions2, action === null || action === void 0 ? void 0 : action.name)) === null || _schema$actions2$acti === void 0 ? void 0 : _schema$actions2$acti.channel);
2376
2388
  };
2377
- var recipientOf = function recipientOf(_ref0) {
2389
+ var recipientOf = function recipientOf(_ref1) {
2378
2390
  var _action$recipient, _schema$actions3, _schema$actions3$acti;
2379
- var schema = _ref0.schema,
2380
- action = _ref0.action;
2391
+ var schema = _ref1.schema,
2392
+ action = _ref1.action;
2381
2393
  return (_action$recipient = action === null || action === void 0 ? void 0 : action.recipient) !== null && _action$recipient !== void 0 ? _action$recipient : (_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 || (_schema$actions3$acti = _schema$actions3.actionForName) === null || _schema$actions3$acti === void 0 || (_schema$actions3$acti = _schema$actions3$acti.call(_schema$actions3, action === null || action === void 0 ? void 0 : action.name)) === null || _schema$actions3$acti === void 0 ? void 0 : _schema$actions3$acti.recipient;
2382
2394
  };
2383
- var channelMetaOf = function channelMetaOf(_ref1) {
2395
+ var channelMetaOf = function channelMetaOf(_ref10) {
2384
2396
  var _schema$actions4;
2385
- var schema = _ref1.schema,
2386
- action = _ref1.action;
2397
+ var schema = _ref10.schema,
2398
+ action = _ref10.action;
2387
2399
  return ((_schema$actions4 = schema.actions) === null || _schema$actions4 === void 0 || (_schema$actions4 = _schema$actions4.channelMeta) === null || _schema$actions4 === void 0 ? void 0 : _schema$actions4[channelOf({
2388
2400
  schema: schema,
2389
2401
  action: action
2390
2402
  })]) || {};
2391
2403
  };
2392
- var actionHasConfig = function actionHasConfig(_ref10) {
2404
+ var actionHasConfig = function actionHasConfig(_ref11) {
2393
2405
  var _schema$actions5, _schema$actions6;
2394
- var schema = _ref10.schema,
2395
- action = _ref10.action;
2406
+ var schema = _ref11.schema,
2407
+ action = _ref11.action;
2396
2408
  var meta = channelMetaOf({
2397
2409
  schema: schema,
2398
2410
  action: action
@@ -2406,10 +2418,10 @@ var actionHasConfig = function actionHasConfig(_ref10) {
2406
2418
  if ((_schema$actions5 = schema.actions) !== null && _schema$actions5 !== void 0 && _schema$actions5.hasConfig) return schema.actions.hasConfig(action);
2407
2419
  return !!((_schema$actions6 = schema.actions) !== null && _schema$actions6 !== void 0 && _schema$actions6.renderConfig);
2408
2420
  };
2409
- var recipientsFor = function recipientsFor(_ref11) {
2421
+ var recipientsFor = function recipientsFor(_ref12) {
2410
2422
  var _schema$actions7, _schema$actions8;
2411
- var schema = _ref11.schema,
2412
- action = _ref11.action;
2423
+ var schema = _ref12.schema,
2424
+ action = _ref12.action;
2413
2425
  var channel = channelOf({
2414
2426
  schema: schema,
2415
2427
  action: action
@@ -2426,10 +2438,10 @@ var recipientsFor = function recipientsFor(_ref11) {
2426
2438
  };
2427
2439
 
2428
2440
  // Each action runs once per rule, so hide recipients another row already uses.
2429
- var availableRecipients = function availableRecipients(_ref12) {
2430
- var schema = _ref12.schema,
2431
- rule = _ref12.rule,
2432
- index = _ref12.index;
2441
+ var availableRecipients = function availableRecipients(_ref13) {
2442
+ var schema = _ref13.schema,
2443
+ rule = _ref13.rule,
2444
+ index = _ref13.index;
2433
2445
  var action = actionAt({
2434
2446
  rule: rule,
2435
2447
  index: index
@@ -2455,12 +2467,12 @@ var availableRecipients = function availableRecipients(_ref12) {
2455
2467
  return !name || !usedNames.includes(name);
2456
2468
  });
2457
2469
  };
2458
- var nextTriggers = function nextTriggers(_ref13) {
2459
- var _schema$triggers;
2460
- var schema = _ref13.schema,
2461
- rule = _ref13.rule,
2462
- value = _ref13.value;
2463
- if ((_schema$triggers = schema.triggers) !== null && _schema$triggers !== void 0 && _schema$triggers.multi) {
2470
+ var nextTriggers = function nextTriggers(_ref14) {
2471
+ var _schema$triggers2;
2472
+ var schema = _ref14.schema,
2473
+ rule = _ref14.rule,
2474
+ value = _ref14.value;
2475
+ if ((_schema$triggers2 = schema.triggers) !== null && _schema$triggers2 !== void 0 && _schema$triggers2.multi) {
2464
2476
  var names = ramda.pluck("name", rule.triggers);
2465
2477
  return names.includes(value) ? neetoCist.removeBy({
2466
2478
  name: value
@@ -2472,12 +2484,12 @@ var nextTriggers = function nextTriggers(_ref13) {
2472
2484
  name: value
2473
2485
  })];
2474
2486
  };
2475
- var nextConditionAt = function nextConditionAt(_ref14) {
2487
+ var nextConditionAt = function nextConditionAt(_ref15) {
2476
2488
  var _field$allowMatching;
2477
- var schema = _ref14.schema,
2478
- rule = _ref14.rule,
2479
- index = _ref14.index,
2480
- value = _ref14.value;
2489
+ var schema = _ref15.schema,
2490
+ rule = _ref15.rule,
2491
+ index = _ref15.index,
2492
+ value = _ref15.value;
2481
2493
  var field = findField({
2482
2494
  schema: schema,
2483
2495
  value: value
@@ -2496,12 +2508,12 @@ var nextConditionAt = function nextConditionAt(_ref14) {
2496
2508
  metadata: {}
2497
2509
  });
2498
2510
  };
2499
- var nextActionAt = function nextActionAt(_ref15) {
2511
+ var nextActionAt = function nextActionAt(_ref16) {
2500
2512
  var _schema$actions0;
2501
- var schema = _ref15.schema,
2502
- rule = _ref15.rule,
2503
- index = _ref15.index,
2504
- value = _ref15.value;
2513
+ var schema = _ref16.schema,
2514
+ rule = _ref16.rule,
2515
+ index = _ref16.index,
2516
+ value = _ref16.value;
2505
2517
  if (!((_schema$actions0 = schema.actions) !== null && _schema$actions0 !== void 0 && _schema$actions0.resolveName)) {
2506
2518
  var option = findActionOption({
2507
2519
  schema: schema,
@@ -2559,11 +2571,11 @@ var nextActionAt = function nextActionAt(_ref15) {
2559
2571
  metadata: channelChanged ? {} : prev.metadata
2560
2572
  });
2561
2573
  };
2562
- var appendScopeItem = function appendScopeItem(_ref16) {
2574
+ var appendScopeItem = function appendScopeItem(_ref17) {
2563
2575
  var _sc$requiresPhone;
2564
- var schema = _ref16.schema,
2565
- rule = _ref16.rule,
2566
- value = _ref16.value;
2576
+ var schema = _ref17.schema,
2577
+ rule = _ref17.rule,
2578
+ value = _ref17.value;
2567
2579
  var sc = schema.scope || {};
2568
2580
  var option = (sc.options || []).find(function (candidate) {
2569
2581
  return optionValue(candidate) === value;
@@ -2580,12 +2592,12 @@ var appendScopeItem = function appendScopeItem(_ref16) {
2580
2592
  phoneField: phoneFields[0].value
2581
2593
  }) : option;
2582
2594
  };
2583
- var nextActionRecipientAt = function nextActionRecipientAt(_ref17) {
2595
+ var nextActionRecipientAt = function nextActionRecipientAt(_ref18) {
2584
2596
  var _schema$actions10;
2585
- var schema = _ref17.schema,
2586
- rule = _ref17.rule,
2587
- index = _ref17.index,
2588
- value = _ref17.value;
2597
+ var schema = _ref18.schema,
2598
+ rule = _ref18.rule,
2599
+ index = _ref18.index,
2600
+ value = _ref18.value;
2589
2601
  var prev = actionAt({
2590
2602
  rule: rule,
2591
2603
  index: index
@@ -2602,32 +2614,39 @@ var nextActionRecipientAt = function nextActionRecipientAt(_ref17) {
2602
2614
  }) : value
2603
2615
  });
2604
2616
  };
2605
- var descriptorFor = function descriptorFor(_ref18) {
2617
+ var descriptorFor = function descriptorFor(_ref19) {
2606
2618
  var _schema$actor2;
2607
- var anchor = _ref18.anchor,
2608
- schema = _ref18.schema,
2609
- rule = _ref18.rule,
2610
- index = _ref18.index,
2611
- stepKey = _ref18.stepKey;
2619
+ var anchor = _ref19.anchor,
2620
+ schema = _ref19.schema,
2621
+ rule = _ref19.rule,
2622
+ index = _ref19.index,
2623
+ stepKey = _ref19.stepKey;
2612
2624
  switch (anchor) {
2613
2625
  case BUILDER_ANCHORS.TRIGGER_ADD:
2614
2626
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
2615
2627
  {
2616
- var _schema$triggers2, _schema$actor, _schema$triggers3;
2617
- var multi = !!((_schema$triggers2 = schema.triggers) !== null && _schema$triggers2 !== void 0 && _schema$triggers2.multi);
2628
+ var _schema$triggers3, _schema$actor, _schema$triggers4;
2629
+ var multi = !!((_schema$triggers3 = schema.triggers) !== null && _schema$triggers3 !== void 0 && _schema$triggers3.multi);
2618
2630
  var isReplace = anchor === BUILDER_ANCHORS.TRIGGER_REPLACE;
2619
2631
  var triggerTitle = isReplace ? multi && i18next.t("neetoRules.builder.panes.changeTriggers") || i18next.t("neetoRules.builder.panes.changeTrigger") : multi && i18next.t("neetoRules.builder.panes.whenEllipsis") || i18next.t("neetoRules.builder.panes.addTrigger");
2632
+ var group = activeTriggerGroup({
2633
+ schema: schema,
2634
+ rule: rule
2635
+ });
2620
2636
  var triggerSubtitle = multi && i18next.t("neetoRules.builder.panes.triggerSubtitleMulti") || (isReplace ? i18next.t("neetoRules.builder.panes.triggerSubtitleReplace") : i18next.t("neetoRules.builder.panes.triggerSubtitleAdd"));
2621
2637
  return {
2622
2638
  title: triggerTitle,
2623
2639
  subtitle: triggerSubtitle,
2624
2640
  multi: multi,
2625
2641
  cascade: !!((_schema$actor = schema.actor) !== null && _schema$actor !== void 0 && _schema$actor.enabled),
2626
- options: (((_schema$triggers3 = schema.triggers) === null || _schema$triggers3 === void 0 ? void 0 : _schema$triggers3.options) || []).map(function (option) {
2642
+ options: (((_schema$triggers4 = schema.triggers) === null || _schema$triggers4 === void 0 ? void 0 : _schema$triggers4.options) || []).map(function (option) {
2643
+ var isLocked = multi && !!group && !!option.group && option.group !== group;
2627
2644
  return {
2628
2645
  label: option.paneLabel || option.label,
2629
2646
  value: triggerValue(option),
2630
- category: option.category
2647
+ category: option.category,
2648
+ disabled: isLocked,
2649
+ disabledTooltip: isLocked && (schema.triggers.groupDisabledTooltip || i18next.t("neetoRules.builder.panes.triggerGroupDisabled"))
2631
2650
  };
2632
2651
  }),
2633
2652
  selectedValues: ramda.pluck("name", rule.triggers)
@@ -2897,14 +2916,14 @@ var descriptorFor = function descriptorFor(_ref18) {
2897
2916
  };
2898
2917
  }
2899
2918
  };
2900
- var commitFor = function commitFor(_ref19) {
2901
- var anchor = _ref19.anchor,
2902
- schema = _ref19.schema,
2903
- rule = _ref19.rule,
2904
- index = _ref19.index,
2905
- stepKey = _ref19.stepKey,
2906
- value = _ref19.value,
2907
- helpers = _ref19.helpers;
2919
+ var commitFor = function commitFor(_ref20) {
2920
+ var anchor = _ref20.anchor,
2921
+ schema = _ref20.schema,
2922
+ rule = _ref20.rule,
2923
+ index = _ref20.index,
2924
+ stepKey = _ref20.stepKey,
2925
+ value = _ref20.value,
2926
+ helpers = _ref20.helpers;
2908
2927
  var setTriggers = helpers.setTriggers,
2909
2928
  setPerformer = helpers.setPerformer,
2910
2929
  setConditionMode = helpers.setConditionMode,
@@ -2914,21 +2933,15 @@ var commitFor = function commitFor(_ref19) {
2914
2933
  case BUILDER_ANCHORS.TRIGGER_ADD:
2915
2934
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
2916
2935
  {
2917
- var _schema$triggers4, _schema$triggers5;
2918
- if ((_schema$triggers4 = schema.triggers) !== null && _schema$triggers4 !== void 0 && _schema$triggers4.multi) {
2919
- var names = ramda.pluck("name", rule.triggers);
2920
- setTriggers(names.includes(value) ? neetoCist.removeBy({
2921
- name: value
2922
- }, rule.triggers) : [].concat(_toConsumableArray(rule.triggers), [{
2923
- name: value
2924
- }]));
2925
- return "stay";
2926
- }
2927
- setTriggers([_objectSpread$6(_objectSpread$6({}, rule.triggers[0]), {}, {
2928
- name: value
2929
- })]);
2936
+ var _schema$triggers5;
2937
+ var triggers = nextTriggers({
2938
+ schema: schema,
2939
+ rule: rule,
2940
+ value: value
2941
+ });
2942
+ setTriggers(triggers);
2930
2943
  var leadTime = (_schema$triggers5 = schema.triggers) === null || _schema$triggers5 === void 0 ? void 0 : _schema$triggers5.leadTime;
2931
- if (leadTime !== null && leadTime !== void 0 && leadTime.fieldKey && (leadTime.appliesTo || []).includes(value) && !rule.leadTime) {
2944
+ if (leadTime !== null && leadTime !== void 0 && leadTime.fieldKey && (leadTime.appliesTo || []).includes(value) && ramda.pluck("name", triggers).includes(value) && !rule.leadTime) {
2932
2945
  var _leadTime$default;
2933
2946
  // eslint-disable-next-line @bigbinary/neeto/use-common-constants
2934
2947
  setFieldValue("".concat(leadTime.fieldKey, ".value"), (_leadTime$default = leadTime["default"]) !== null && _leadTime$default !== void 0 ? _leadTime$default : 10);
@@ -3009,14 +3022,14 @@ var commitFor = function commitFor(_ref19) {
3009
3022
  return "close";
3010
3023
  }
3011
3024
  };
3012
- var continueTargetFor = function continueTargetFor(_ref20) {
3025
+ var continueTargetFor = function continueTargetFor(_ref21) {
3013
3026
  var _schema$actor3;
3014
- var anchor = _ref20.anchor,
3015
- schema = _ref20.schema,
3016
- rule = _ref20.rule,
3017
- index = _ref20.index,
3018
- stepKey = _ref20.stepKey,
3019
- configPending = _ref20.configPending;
3027
+ var anchor = _ref21.anchor,
3028
+ schema = _ref21.schema,
3029
+ rule = _ref21.rule,
3030
+ index = _ref21.index,
3031
+ stepKey = _ref21.stepKey,
3032
+ configPending = _ref21.configPending;
3020
3033
  switch (anchor) {
3021
3034
  case BUILDER_ANCHORS.TRIGGER_ADD:
3022
3035
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
@@ -3128,26 +3141,27 @@ var continueTargetFor = function continueTargetFor(_ref20) {
3128
3141
  return null;
3129
3142
  }
3130
3143
  };
3131
- var replaceAt = function replaceAt(_ref21) {
3132
- var list = _ref21.list,
3133
- index = _ref21.index,
3134
- item = _ref21.item;
3144
+ var replaceAt = function replaceAt(_ref22) {
3145
+ var list = _ref22.list,
3146
+ index = _ref22.index,
3147
+ item = _ref22.item;
3135
3148
  var next = _toConsumableArray(list);
3136
3149
  // eslint-disable-next-line security/detect-object-injection
3137
3150
  next[index] = item;
3138
3151
  return next;
3139
3152
  };
3140
- var applyPreview = function applyPreview(_ref22) {
3141
- var rule = _ref22.rule,
3142
- schema = _ref22.schema,
3143
- anchor = _ref22.anchor,
3144
- index = _ref22.index,
3145
- value = _ref22.value;
3153
+ var applyPreview = function applyPreview(_ref23) {
3154
+ var rule = _ref23.rule,
3155
+ schema = _ref23.schema,
3156
+ anchor = _ref23.anchor,
3157
+ index = _ref23.index,
3158
+ value = _ref23.value;
3146
3159
  switch (anchor) {
3147
3160
  case BUILDER_ANCHORS.TRIGGER_ADD:
3148
3161
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
3149
- return _objectSpread$6(_objectSpread$6({}, rule), {}, {
3150
- triggers: Array.isArray(value) ? value.map(function (name) {
3162
+ {
3163
+ var _schema$triggers6, _leadTime$default2;
3164
+ var triggers = Array.isArray(value) ? value.map(function (name) {
3151
3165
  return {
3152
3166
  name: name
3153
3167
  };
@@ -3155,8 +3169,18 @@ var applyPreview = function applyPreview(_ref22) {
3155
3169
  schema: schema,
3156
3170
  rule: rule,
3157
3171
  value: value
3158
- })
3159
- });
3172
+ });
3173
+ var leadTime = (_schema$triggers6 = schema.triggers) === null || _schema$triggers6 === void 0 ? void 0 : _schema$triggers6.leadTime;
3174
+ var needsDefaultLeadTime = !!(leadTime !== null && leadTime !== void 0 && leadTime.fieldKey) && !rule.leadTime && triggers.some(function (_ref24) {
3175
+ var name = _ref24.name;
3176
+ return (leadTime.appliesTo || []).includes(name);
3177
+ });
3178
+ return _objectSpread$6(_objectSpread$6({}, rule), {}, {
3179
+ triggers: triggers
3180
+ }, needsDefaultLeadTime && {
3181
+ leadTime: (_leadTime$default2 = leadTime["default"]) !== null && _leadTime$default2 !== void 0 ? _leadTime$default2 : 10
3182
+ });
3183
+ }
3160
3184
  case BUILDER_ANCHORS.TRIGGER_ACTOR:
3161
3185
  return _objectSpread$6(_objectSpread$6({}, rule), {}, {
3162
3186
  performer: value
@@ -4681,6 +4705,8 @@ var OptionsPane = function OptionsPane(_ref) {
4681
4705
  return selectedValues.includes(optionValue) ? selectedValues.filter(neetoCist.isNot(optionValue)) : [].concat(_toConsumableArray(selectedValues.filter(Boolean)), [optionValue]);
4682
4706
  };
4683
4707
  var previewHandlers = function previewHandlers(optionValue) {
4708
+ var isDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4709
+ if (isDisabled) return {};
4684
4710
  var value = multi ? multiCandidate(optionValue) : optionValue;
4685
4711
  return {
4686
4712
  onMouseEnter: function onMouseEnter() {
@@ -4755,7 +4781,15 @@ var OptionsPane = function OptionsPane(_ref) {
4755
4781
  var popover = option.disabledPopover || (isNodeReason ? {
4756
4782
  description: reason
4757
4783
  } : null);
4758
- if (!Icon && !isTextReason && !popover) return option.label;
4784
+ if (!Icon && !isTextReason && !popover) {
4785
+ return option.disabled && option.disabledTooltip ? /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Tooltip, {
4786
+ content: option.disabledTooltip,
4787
+ position: "top",
4788
+ children: /*#__PURE__*/jsxRuntime.jsx("span", {
4789
+ children: option.label
4790
+ })
4791
+ }) : option.label;
4792
+ }
4759
4793
  return /*#__PURE__*/jsxRuntime.jsxs("span", {
4760
4794
  className: "mb-pane-option",
4761
4795
  children: [Icon && /*#__PURE__*/jsxRuntime.jsx(Icon, {
@@ -4823,13 +4857,13 @@ var OptionsPane = function OptionsPane(_ref) {
4823
4857
  checked: isSelected(option.value),
4824
4858
  disabled: option.disabled,
4825
4859
  label: optionLabel(option),
4826
- labelProps: previewHandlers(option.value),
4860
+ labelProps: previewHandlers(option.value, option.disabled),
4827
4861
  onCheckedChange: function onCheckedChange() {
4828
4862
  return handleSelect(option.value);
4829
4863
  }
4830
4864
  }, option.icon || option.disabledReason ? {
4831
4865
  dataTestid: option.value
4832
- } : {}), previewHandlers(option.value)), option.value);
4866
+ } : {}), previewHandlers(option.value, option.disabled)), option.value);
4833
4867
  })]
4834
4868
  }, category || "_uncategorized");
4835
4869
  })
@@ -4850,11 +4884,11 @@ var OptionsPane = function OptionsPane(_ref) {
4850
4884
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup.Item, _objectSpread$3(_objectSpread$3({
4851
4885
  disabled: option.disabled,
4852
4886
  label: optionLabel(option),
4853
- labelProps: previewHandlers(option.value),
4887
+ labelProps: previewHandlers(option.value, option.disabled),
4854
4888
  value: option.value
4855
4889
  }, option.icon || option.disabledReason ? {
4856
4890
  "data-testid": option.value
4857
- } : {}), previewHandlers(option.value)), option.value);
4891
+ } : {}), previewHandlers(option.value, option.disabled)), option.value);
4858
4892
  })));
4859
4893
  }).filter(Boolean)
4860
4894
  });