@automagik/omni 2.260921.3 → 2.260922.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/index.js CHANGED
@@ -137424,7 +137424,7 @@ import { fileURLToPath } from "url";
137424
137424
  // package.json
137425
137425
  var package_default = {
137426
137426
  name: "@automagik/omni",
137427
- version: "2.260921.3",
137427
+ version: "2.260922.1",
137428
137428
  repository: {
137429
137429
  type: "git",
137430
137430
  url: "git+https://github.com/automagik-dev/omni.git",
@@ -251115,7 +251115,7 @@ var init_sentry_scrub = __esm(() => {
251115
251115
  var require_package7 = __commonJS((exports, module) => {
251116
251116
  module.exports = {
251117
251117
  name: "@omni/api",
251118
- version: "2.260921.3",
251118
+ version: "2.260922.1",
251119
251119
  private: true,
251120
251120
  type: "module",
251121
251121
  exports: {
@@ -404755,6 +404755,11 @@ var MAX_BODY_TEXT = 1024;
404755
404755
  var TIPO_LISTA = 1;
404756
404756
  var TIPO_BOTOES = 2;
404757
404757
  var LIST_BUTTON_LABEL = "Op\xE7\xF5es";
404758
+ var MAX_LIST_BUTTON_LABEL = 20;
404759
+ function listButtonLabelOf(label) {
404760
+ const trimmed = label?.trim();
404761
+ return trimmed && trimmed.length <= MAX_LIST_BUTTON_LABEL ? trimmed : LIST_BUTTON_LABEL;
404762
+ }
404758
404763
  function foldTitle(value) {
404759
404764
  return value.normalize("NFD").replace(/\p{Mn}/gu, "").toLocaleLowerCase().split(/\s+/).filter(Boolean).join(" ");
404760
404765
  }
@@ -404777,7 +404782,8 @@ function buildInteractive(body, buttons, listOptions = {}) {
404777
404782
  const replyButtons = (buttons ?? []).filter((b2) => !b2.url && b2.text?.trim());
404778
404783
  if (replyButtons.length === 0 || replyButtons.length > MAX_OPTIONS)
404779
404784
  return null;
404780
- const plan = planInteractive(trimmed, replyButtons, LIST_BUTTON_LABEL, listOptions);
404785
+ const buttonLabel = listButtonLabelOf(listOptions.buttonLabel);
404786
+ const plan = planInteractive(trimmed, replyButtons, buttonLabel, listOptions);
404781
404787
  if (!plan.interactive || plan.droppedRows > 0)
404782
404788
  return null;
404783
404789
  const type = plan.interactive.type;
@@ -404798,7 +404804,7 @@ function buildInteractive(body, buttons, listOptions = {}) {
404798
404804
  tipo: TIPO_LISTA,
404799
404805
  mensagem: trimmed,
404800
404806
  list: {
404801
- texto_botao: action?.button || LIST_BUTTON_LABEL,
404807
+ texto_botao: action?.button || buttonLabel,
404802
404808
  secao: [
404803
404809
  {
404804
404810
  texto: sections[0]?.title ?? "",
@@ -405111,6 +405117,7 @@ function collectTurnParts(message2, turn) {
405111
405117
  }
405112
405118
  function listOptionsOf(content) {
405113
405119
  return {
405120
+ ...content.list?.buttonLabel !== undefined ? { buttonLabel: content.list.buttonLabel } : {},
405114
405121
  ...content.list?.sectionTitle !== undefined ? { sectionTitle: content.list.sectionTitle } : {},
405115
405122
  ...content.list?.forceList !== undefined ? { forceList: content.list.forceList } : {}
405116
405123
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260921.3",
3
+ "version": "2.260922.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/automagik-dev/omni.git",