@botonic/react 0.41.1-alpha.0 → 0.42.0-alpha.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.
Files changed (151) hide show
  1. package/lib/cjs/components/index-types.d.ts +0 -1
  2. package/lib/cjs/components/index.d.ts +0 -1
  3. package/lib/cjs/components/index.js +1 -3
  4. package/lib/cjs/components/index.js.map +1 -1
  5. package/lib/cjs/components/multichannel/whatsapp/constants.d.ts +0 -1
  6. package/lib/cjs/components/multichannel/whatsapp/constants.js +1 -2
  7. package/lib/cjs/components/multichannel/whatsapp/constants.js.map +1 -1
  8. package/lib/cjs/components/system-debug-trace/debug-message.js +22 -0
  9. package/lib/cjs/components/system-debug-trace/debug-message.js.map +1 -1
  10. package/lib/cjs/components/system-debug-trace/events/bot-action.d.ts +7 -0
  11. package/lib/cjs/components/system-debug-trace/events/bot-action.js +18 -0
  12. package/lib/cjs/components/system-debug-trace/events/bot-action.js.map +1 -0
  13. package/lib/cjs/components/system-debug-trace/events/conditional-channel.d.ts +7 -0
  14. package/lib/cjs/components/system-debug-trace/events/conditional-channel.js +18 -0
  15. package/lib/cjs/components/system-debug-trace/events/conditional-channel.js.map +1 -0
  16. package/lib/cjs/components/system-debug-trace/events/conditional-country.d.ts +7 -0
  17. package/lib/cjs/components/system-debug-trace/events/conditional-country.js +18 -0
  18. package/lib/cjs/components/system-debug-trace/events/conditional-country.js.map +1 -0
  19. package/lib/cjs/components/system-debug-trace/events/conditional-custom.d.ts +8 -0
  20. package/lib/cjs/components/system-debug-trace/events/conditional-custom.js +18 -0
  21. package/lib/cjs/components/system-debug-trace/events/conditional-custom.js.map +1 -0
  22. package/lib/cjs/components/system-debug-trace/events/conditional-queue-status.d.ts +10 -0
  23. package/lib/cjs/components/system-debug-trace/events/conditional-queue-status.js +20 -0
  24. package/lib/cjs/components/system-debug-trace/events/conditional-queue-status.js.map +1 -0
  25. package/lib/cjs/components/system-debug-trace/events/constants.d.ts +4 -0
  26. package/lib/cjs/components/system-debug-trace/events/constants.js +4 -0
  27. package/lib/cjs/components/system-debug-trace/events/constants.js.map +1 -1
  28. package/lib/cjs/components/system-debug-trace/events/handoff-success.d.ts +2 -0
  29. package/lib/cjs/components/system-debug-trace/events/handoff-success.js +23 -4
  30. package/lib/cjs/components/system-debug-trace/events/handoff-success.js.map +1 -1
  31. package/lib/cjs/components/system-debug-trace/events/index.d.ts +7 -0
  32. package/lib/cjs/components/system-debug-trace/events/index.js +7 -0
  33. package/lib/cjs/components/system-debug-trace/events/index.js.map +1 -1
  34. package/lib/cjs/components/system-debug-trace/events/redirect-flow.d.ts +10 -0
  35. package/lib/cjs/components/system-debug-trace/events/redirect-flow.js +18 -0
  36. package/lib/cjs/components/system-debug-trace/events/redirect-flow.js.map +1 -0
  37. package/lib/cjs/components/system-debug-trace/events/webview-action-triggered.d.ts +8 -0
  38. package/lib/cjs/components/system-debug-trace/events/webview-action-triggered.js +18 -0
  39. package/lib/cjs/components/system-debug-trace/events/webview-action-triggered.js.map +1 -0
  40. package/lib/cjs/components/system-debug-trace/icons/arrow-progress.d.ts +2 -0
  41. package/lib/cjs/components/system-debug-trace/icons/arrow-progress.js +10 -0
  42. package/lib/cjs/components/system-debug-trace/icons/arrow-progress.js.map +1 -0
  43. package/lib/cjs/components/system-debug-trace/icons/code.d.ts +2 -0
  44. package/lib/cjs/components/system-debug-trace/icons/code.js +10 -0
  45. package/lib/cjs/components/system-debug-trace/icons/code.js.map +1 -0
  46. package/lib/cjs/components/system-debug-trace/icons/split.d.ts +2 -0
  47. package/lib/cjs/components/system-debug-trace/icons/split.js +10 -0
  48. package/lib/cjs/components/system-debug-trace/icons/split.js.map +1 -0
  49. package/lib/cjs/components/system-debug-trace/icons/window-restore.d.ts +2 -0
  50. package/lib/cjs/components/system-debug-trace/icons/window-restore.js +10 -0
  51. package/lib/cjs/components/system-debug-trace/icons/window-restore.js.map +1 -0
  52. package/lib/cjs/components/system-debug-trace/styles.js +7 -4
  53. package/lib/cjs/components/system-debug-trace/styles.js.map +1 -1
  54. package/lib/cjs/components/system-debug-trace/types.d.ts +2 -2
  55. package/lib/cjs/components/whatsapp-media-carousel.js +0 -3
  56. package/lib/cjs/components/whatsapp-media-carousel.js.map +1 -1
  57. package/lib/cjs/index-types.d.ts +8 -0
  58. package/lib/cjs/index-types.js.map +1 -1
  59. package/lib/cjs/webchat/context/index.js +14 -0
  60. package/lib/cjs/webchat/context/index.js.map +1 -1
  61. package/lib/esm/components/index-types.d.ts +0 -1
  62. package/lib/esm/components/index.d.ts +0 -1
  63. package/lib/esm/components/index.js +0 -1
  64. package/lib/esm/components/index.js.map +1 -1
  65. package/lib/esm/components/multichannel/whatsapp/constants.d.ts +0 -1
  66. package/lib/esm/components/multichannel/whatsapp/constants.js +0 -1
  67. package/lib/esm/components/multichannel/whatsapp/constants.js.map +1 -1
  68. package/lib/esm/components/system-debug-trace/debug-message.js +24 -2
  69. package/lib/esm/components/system-debug-trace/debug-message.js.map +1 -1
  70. package/lib/esm/components/system-debug-trace/events/bot-action.d.ts +7 -0
  71. package/lib/esm/components/system-debug-trace/events/bot-action.js +14 -0
  72. package/lib/esm/components/system-debug-trace/events/bot-action.js.map +1 -0
  73. package/lib/esm/components/system-debug-trace/events/conditional-channel.d.ts +7 -0
  74. package/lib/esm/components/system-debug-trace/events/conditional-channel.js +14 -0
  75. package/lib/esm/components/system-debug-trace/events/conditional-channel.js.map +1 -0
  76. package/lib/esm/components/system-debug-trace/events/conditional-country.d.ts +7 -0
  77. package/lib/esm/components/system-debug-trace/events/conditional-country.js +14 -0
  78. package/lib/esm/components/system-debug-trace/events/conditional-country.js.map +1 -0
  79. package/lib/esm/components/system-debug-trace/events/conditional-custom.d.ts +8 -0
  80. package/lib/esm/components/system-debug-trace/events/conditional-custom.js +14 -0
  81. package/lib/esm/components/system-debug-trace/events/conditional-custom.js.map +1 -0
  82. package/lib/esm/components/system-debug-trace/events/conditional-queue-status.d.ts +10 -0
  83. package/lib/esm/components/system-debug-trace/events/conditional-queue-status.js +16 -0
  84. package/lib/esm/components/system-debug-trace/events/conditional-queue-status.js.map +1 -0
  85. package/lib/esm/components/system-debug-trace/events/constants.d.ts +4 -0
  86. package/lib/esm/components/system-debug-trace/events/constants.js +4 -0
  87. package/lib/esm/components/system-debug-trace/events/constants.js.map +1 -1
  88. package/lib/esm/components/system-debug-trace/events/handoff-success.d.ts +2 -0
  89. package/lib/esm/components/system-debug-trace/events/handoff-success.js +23 -4
  90. package/lib/esm/components/system-debug-trace/events/handoff-success.js.map +1 -1
  91. package/lib/esm/components/system-debug-trace/events/index.d.ts +7 -0
  92. package/lib/esm/components/system-debug-trace/events/index.js +7 -0
  93. package/lib/esm/components/system-debug-trace/events/index.js.map +1 -1
  94. package/lib/esm/components/system-debug-trace/events/redirect-flow.d.ts +10 -0
  95. package/lib/esm/components/system-debug-trace/events/redirect-flow.js +14 -0
  96. package/lib/esm/components/system-debug-trace/events/redirect-flow.js.map +1 -0
  97. package/lib/esm/components/system-debug-trace/events/webview-action-triggered.d.ts +8 -0
  98. package/lib/esm/components/system-debug-trace/events/webview-action-triggered.js +14 -0
  99. package/lib/esm/components/system-debug-trace/events/webview-action-triggered.js.map +1 -0
  100. package/lib/esm/components/system-debug-trace/icons/arrow-progress.d.ts +2 -0
  101. package/lib/esm/components/system-debug-trace/icons/arrow-progress.js +6 -0
  102. package/lib/esm/components/system-debug-trace/icons/arrow-progress.js.map +1 -0
  103. package/lib/esm/components/system-debug-trace/icons/code.d.ts +2 -0
  104. package/lib/esm/components/system-debug-trace/icons/code.js +6 -0
  105. package/lib/esm/components/system-debug-trace/icons/code.js.map +1 -0
  106. package/lib/esm/components/system-debug-trace/icons/split.d.ts +2 -0
  107. package/lib/esm/components/system-debug-trace/icons/split.js +6 -0
  108. package/lib/esm/components/system-debug-trace/icons/split.js.map +1 -0
  109. package/lib/esm/components/system-debug-trace/icons/window-restore.d.ts +2 -0
  110. package/lib/esm/components/system-debug-trace/icons/window-restore.js +6 -0
  111. package/lib/esm/components/system-debug-trace/icons/window-restore.js.map +1 -0
  112. package/lib/esm/components/system-debug-trace/styles.js +7 -4
  113. package/lib/esm/components/system-debug-trace/styles.js.map +1 -1
  114. package/lib/esm/components/system-debug-trace/types.d.ts +2 -2
  115. package/lib/esm/components/whatsapp-media-carousel.js +0 -3
  116. package/lib/esm/components/whatsapp-media-carousel.js.map +1 -1
  117. package/lib/esm/index-types.d.ts +8 -0
  118. package/lib/esm/index-types.js.map +1 -1
  119. package/lib/esm/webchat/context/index.js +14 -0
  120. package/lib/esm/webchat/context/index.js.map +1 -1
  121. package/package.json +2 -2
  122. package/src/components/index-types.ts +0 -1
  123. package/src/components/index.ts +0 -4
  124. package/src/components/multichannel/whatsapp/constants.ts +0 -1
  125. package/src/components/system-debug-trace/debug-message.tsx +30 -2
  126. package/src/components/system-debug-trace/events/bot-action.tsx +28 -0
  127. package/src/components/system-debug-trace/events/conditional-channel.tsx +28 -0
  128. package/src/components/system-debug-trace/events/conditional-country.tsx +28 -0
  129. package/src/components/system-debug-trace/events/conditional-custom.tsx +29 -0
  130. package/src/components/system-debug-trace/events/conditional-queue-status.tsx +37 -0
  131. package/src/components/system-debug-trace/events/constants.ts +4 -0
  132. package/src/components/system-debug-trace/events/handoff-success.tsx +45 -8
  133. package/src/components/system-debug-trace/events/index.ts +7 -0
  134. package/src/components/system-debug-trace/events/redirect-flow.tsx +31 -0
  135. package/src/components/system-debug-trace/events/webview-action-triggered.tsx +29 -0
  136. package/src/components/system-debug-trace/icons/arrow-progress.tsx +15 -0
  137. package/src/components/system-debug-trace/icons/code.tsx +15 -0
  138. package/src/components/system-debug-trace/icons/split.tsx +15 -0
  139. package/src/components/system-debug-trace/icons/window-restore.tsx +15 -0
  140. package/src/components/system-debug-trace/styles.ts +7 -4
  141. package/src/components/system-debug-trace/types.ts +14 -0
  142. package/src/components/whatsapp-media-carousel.tsx +0 -3
  143. package/src/index-types.ts +9 -0
  144. package/src/webchat/context/index.tsx +17 -0
  145. package/lib/cjs/components/whatsapp-interactive-media-carousel.d.ts +0 -15
  146. package/lib/cjs/components/whatsapp-interactive-media-carousel.js +0 -19
  147. package/lib/cjs/components/whatsapp-interactive-media-carousel.js.map +0 -1
  148. package/lib/esm/components/whatsapp-interactive-media-carousel.d.ts +0 -15
  149. package/lib/esm/components/whatsapp-interactive-media-carousel.js +0 -15
  150. package/lib/esm/components/whatsapp-interactive-media-carousel.js.map +0 -1
  151. package/src/components/whatsapp-interactive-media-carousel.tsx +0 -52
@@ -0,0 +1,8 @@
1
+ import { EventAction } from '@botonic/core';
2
+ import { DebugEventConfig } from '../types';
3
+ export interface WebviewActionTriggeredDebugEvent {
4
+ action: EventAction.WebviewActionTriggered;
5
+ webview_target_id: string;
6
+ webview_name: string;
7
+ }
8
+ export declare const getWebviewActionTriggeredEventConfig: (data: WebviewActionTriggeredDebugEvent) => DebugEventConfig;
@@ -0,0 +1,14 @@
1
+ import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { EventAction } from '@botonic/core';
3
+ import { WindowRestoreSvg } from '../icons/window-restore';
4
+ export const getWebviewActionTriggeredEventConfig = (data) => {
5
+ const title = (_jsxs(_Fragment, { children: ["Webview action triggered ", _jsxs("span", { children: ["- ", data.webview_name] })] }));
6
+ return {
7
+ action: EventAction.WebviewActionTriggered,
8
+ title,
9
+ component: null,
10
+ icon: _jsx(WindowRestoreSvg, {}),
11
+ collapsible: false,
12
+ };
13
+ };
14
+ //# sourceMappingURL=webview-action-triggered.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webview-action-triggered.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/webview-action-triggered.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAS1D,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,2DAC2B,iCAAS,IAAI,CAAC,YAAY,IAAQ,IAC1D,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,WAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,KAAC,gBAAgB,KAAG;QAC1B,WAAW,EAAE,KAAK;KACnB,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { IconProps } from '../types';
2
+ export declare const ArrowProgressSvg: ({ color }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { COLORS } from '../../../constants';
3
+ export const ArrowProgressSvg = ({ color = COLORS.N500 }) => {
4
+ return (_jsx("svg", Object.assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 640 640', fill: color }, { children: _jsx("path", { d: 'M294.8 97.8C303.8 94.1 314.1 96.1 321 103L361 143C370.4 152.4 370.4 167.6 361 176.9L321 216.9C314.1 223.8 303.8 225.8 294.8 222.1C285.8 218.4 280 209.7 280 200L280 192L176 192C149.5 192 128 213.5 128 240C128 266.5 149.5 288 176 288L464 288C525.9 288 576 338.1 576 400C576 446.4 547.8 486.1 507.7 503.2C498.4 527.1 475.2 544 448 544C412.7 544 384 515.3 384 480C384 444.7 412.7 416 448 416C466.6 416 483.4 423.9 495 436.6C505.4 427.8 512 414.7 512 400C512 373.5 490.5 352 464 352L176 352C114.1 352 64 301.9 64 240C64 178.1 114.1 128 176 128L280 128L280 120C280 110.3 285.8 101.5 294.8 97.8zM480 96C515.3 96 544 124.7 544 160C544 195.3 515.3 224 480 224C444.7 224 416 195.3 416 160C416 124.7 444.7 96 480 96zM215.4 512C204.3 531.1 183.7 544 160 544C124.7 544 96 515.3 96 480C96 444.7 124.7 416 160 416C183.7 416 204.4 428.9 215.4 448L248 448L248 440C248 430.3 253.8 421.5 262.8 417.8C271.8 414.1 282.1 416.1 289 423L329 463C338.4 472.4 338.4 487.6 329 496.9L289 536.9C282.1 543.8 271.8 545.8 262.8 542.1C253.8 538.4 248 529.7 248 520L248 512L215.4 512z', fill: 'currentColor' }) })));
5
+ };
6
+ //# sourceMappingURL=arrow-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-progress.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/icons/arrow-progress.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,IAAI,EAAa,EAAE,EAAE;IACrE,OAAO,CACL,4BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,EAAC,IAAI,EAAE,KAAK,gBACvE,eACE,CAAC,EAAC,2hCAA2hC,EAC7hC,IAAI,EAAC,cAAc,GACnB,IACE,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { IconProps } from '../types';
2
+ export declare const CodeSvg: ({ color }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { COLORS } from '../../../constants';
3
+ export const CodeSvg = ({ color = COLORS.N500 }) => {
4
+ return (_jsx("svg", Object.assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 640 640', fill: color }, { children: _jsx("path", { d: 'M392.8 65.2C375.8 60.3 358.1 70.2 353.2 87.2L225.2 535.2C220.3 552.2 230.2 569.9 247.2 574.8C264.2 579.7 281.9 569.8 286.8 552.8L414.8 104.8C419.7 87.8 409.8 70.1 392.8 65.2zM457.4 201.3C444.9 213.8 444.9 234.1 457.4 246.6L530.8 320L457.4 393.4C444.9 405.9 444.9 426.2 457.4 438.7C469.9 451.2 490.2 451.2 502.7 438.7L598.7 342.7C611.2 330.2 611.2 309.9 598.7 297.4L502.7 201.4C490.2 188.9 469.9 188.9 457.4 201.4zM182.7 201.3C170.2 188.8 149.9 188.8 137.4 201.3L41.4 297.3C28.9 309.8 28.9 330.1 41.4 342.6L137.4 438.6C149.9 451.1 170.2 451.1 182.7 438.6C195.2 426.1 195.2 405.8 182.7 393.3L109.3 320L182.6 246.6C195.1 234.1 195.1 213.8 182.6 201.3z', fill: 'currentColor' }) })));
5
+ };
6
+ //# sourceMappingURL=code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/icons/code.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,IAAI,EAAa,EAAE,EAAE;IAC5D,OAAO,CACL,4BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,EAAC,IAAI,EAAE,KAAK,gBACvE,eACE,CAAC,EAAC,0oBAA0oB,EAC5oB,IAAI,EAAC,cAAc,GACnB,IACE,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { IconProps } from '../types';
2
+ export declare const SplitSvg: ({ color }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { COLORS } from '../../../constants';
3
+ export const SplitSvg = ({ color = COLORS.N500 }) => {
4
+ return (_jsx("svg", Object.assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 640 640', fill: color }, { children: _jsx("path", { d: 'M467.8 66.4C479.8 61.4 493.5 64.2 502.7 73.3L566.7 137.3C572.7 143.3 576.1 151.4 576.1 159.9C576.1 168.4 572.7 176.5 566.7 182.5L502.7 246.5C493.5 255.7 479.8 258.4 467.8 253.4C455.8 248.4 448 236.9 448 224L448 192L410.5 192C402 192 393.9 195.4 387.9 201.4L269.3 320L387.9 438.6C393.9 444.6 402 448 410.5 448L448 448L448 416C448 403.1 455.8 391.4 467.8 386.4C479.8 381.4 493.5 384.2 502.7 393.3L566.7 457.3C572.7 463.3 576.1 471.4 576.1 479.9C576.1 488.4 572.7 496.5 566.7 502.5L502.7 566.5C493.5 575.7 479.8 578.4 467.8 573.4C455.8 568.4 448 556.9 448 544L448 512L410.5 512C385 512 360.6 501.9 342.6 483.9L210.7 352L96 352C78.3 352 64 337.7 64 320C64 302.3 78.3 288 96 288L210.7 288L342.6 156.1C360.6 138.1 385 128 410.5 128L448 128L448 96C448 83.1 455.8 71.4 467.8 66.4z', fill: 'currentColor' }) })));
5
+ };
6
+ //# sourceMappingURL=split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/icons/split.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,IAAI,EAAa,EAAE,EAAE;IAC7D,OAAO,CACL,4BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,EAAC,IAAI,EAAE,KAAK,gBACvE,eACE,CAAC,EAAC,swBAAswB,EACxwB,IAAI,EAAC,cAAc,GACnB,IACE,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { IconProps } from '../types';
2
+ export declare const WindowRestoreSvg: ({ color }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { COLORS } from '../../../constants';
3
+ export const WindowRestoreSvg = ({ color = COLORS.N500 }) => {
4
+ return (_jsx("svg", Object.assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 640 640', fill: color }, { children: _jsx("path", { d: 'M544 160L192 160C192 124.7 220.7 96 256 96L544 96C579.3 96 608 124.7 608 160L608 352C608 387.3 579.3 416 544 416L496 416L496 352L544 352L544 160zM32 288C32 252.7 60.7 224 96 224L384 224C419.3 224 448 252.7 448 288L448 480C448 515.3 419.3 544 384 544L96 544C60.7 544 32 515.3 32 480L32 288zM96 328C96 341.3 106.7 352 120 352L360 352C373.3 352 384 341.3 384 328C384 314.7 373.3 304 360 304L120 304C106.7 304 96 314.7 96 328z', fill: 'currentColor' }) })));
5
+ };
6
+ //# sourceMappingURL=window-restore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-restore.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/icons/window-restore.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,IAAI,EAAa,EAAE,EAAE;IACrE,OAAO,CACL,4BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,aAAa,EAAC,IAAI,EAAE,KAAK,gBACvE,eACE,CAAC,EAAC,waAAwa,EAC1a,IAAI,EAAC,cAAc,GACnB,IACE,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -108,13 +108,14 @@ export const StyledDebugLabel = styled.strong `
108
108
  line-height: 1.5;
109
109
  `;
110
110
  export const StyledDebugValue = styled.div `
111
- display: flex;
112
- align-items: center;
113
- gap: 8px;
114
111
  font-weight: 600;
115
112
  font-size: 12px;
116
113
  color: ${COLORS.N700};
117
114
  line-height: 1.5;
115
+ width: 100%;
116
+ overflow-wrap: break-word;
117
+ word-break: break-word;
118
+ white-space: pre-wrap;
118
119
 
119
120
  > svg {
120
121
  width: 14px;
@@ -122,7 +123,9 @@ export const StyledDebugValue = styled.div `
122
123
  min-width: 14px;
123
124
  min-height: 14px;
124
125
  flex-shrink: 0;
125
- display: block;
126
+ display: inline-block;
127
+ vertical-align: middle;
128
+ margin-right: 8px;
126
129
  }
127
130
  `;
128
131
  export const StyledDebugItemWithIcon = styled.div `
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/components/system-debug-trace/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;sBAOxB,MAAM,CAAC,WAAW;;;;;;;;;;;;;0BAad,MAAM,CAAC,GAAG;;;CAGnC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CAS1C,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;;;;;;CAY1C,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;;;;;;;CAazC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;WAOhC,MAAM,CAAC,IAAI;;;;;;;;CAQrB,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;WAUjC,MAAM,CAAC,IAAI;CACrB,CAAA;AAID,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAwB;;;;;mBAKhD,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;;;;;;CAMlE,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAA;WAClC,MAAM,CAAC,IAAI;;;;CAIrB,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;WAM/B,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AAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;;;;;;;CAO7D,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,CAAC,CAAA;;;;WAIjC,MAAM,CAAC,IAAI;;;;;;;;;;;aAWT,MAAM,CAAC,YAAY;;;;aAInB,MAAM,CAAC,IAAI;;CAEvB,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { AiAgentDebugEvent, FallbackDebugEvent, HandoffSuccessDebugEvent, KeywordDebugEvent, KnowledgeBaseDebugEvent, SmartIntentDebugEvent } from './events';
2
+ import { AiAgentDebugEvent, BotActionDebugEvent, ConditionalChannelDebugEvent, ConditionalCountryDebugEvent, ConditionalCustomDebugEvent, ConditionalQueueStatusDebugEvent, FallbackDebugEvent, HandoffSuccessDebugEvent, KeywordDebugEvent, KnowledgeBaseDebugEvent, RedirectFlowDebugEvent, SmartIntentDebugEvent, WebviewActionTriggeredDebugEvent } from './events';
3
3
  export interface IconProps {
4
4
  color?: string;
5
5
  }
6
- export type DebugEvent = KeywordDebugEvent | AiAgentDebugEvent | KnowledgeBaseDebugEvent | FallbackDebugEvent | SmartIntentDebugEvent | HandoffSuccessDebugEvent;
6
+ export type DebugEvent = KeywordDebugEvent | AiAgentDebugEvent | KnowledgeBaseDebugEvent | FallbackDebugEvent | SmartIntentDebugEvent | HandoffSuccessDebugEvent | BotActionDebugEvent | ConditionalChannelDebugEvent | ConditionalCountryDebugEvent | ConditionalCustomDebugEvent | ConditionalQueueStatusDebugEvent | RedirectFlowDebugEvent | WebviewActionTriggeredDebugEvent;
7
7
  export interface DebugEventConfig {
8
8
  action: string;
9
9
  title: React.ReactNode;
@@ -6,9 +6,6 @@ import { Message } from './message';
6
6
  const serialize = (message) => {
7
7
  return { text: message };
8
8
  };
9
- /*
10
- Reference: https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/media-card-carousel-templates
11
- */
12
9
  export const WhatsappMediaCarousel = (props) => {
13
10
  const renderBrowser = () => {
14
11
  // Return a dummy message for browser
@@ -1 +1 @@
1
- {"version":3,"file":"whatsapp-media-carousel.js","sourceRoot":"","sources":["../../../src/components/whatsapp-media-carousel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAGrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAsDnC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,EAAE;IACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAC1B,CAAC,CAAA;AAED;;EAEE;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAE,EAAE;IACzE,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,qCAAqC;QACrC,MAAM,OAAO,GAAG,oDAAoD,CAAA;QACpE,OAAO,CACL,KAAC,OAAO,kBAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAM,KAAK,IAAE,IAAI,EAAE,KAAK,CAAC,IAAI,gBAC3D,OAAO,IACA,CACX,CAAA;IACH,CAAC,CAAA;IAED,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;YAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;aACvB;YACD,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBACtC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;oBACvB,MAAM,CAAC,WAAW,GAAG,KAAK,CAAA;iBAC3B;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,OAAO,eAAe,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO;QACL,gFAAgF;QAChF,kCACM,KAAK,IACT,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,EACrE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAC5C,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,IAAI,EAAE,KAAK,CAAC,uBAAuB,IACnC,CACH,CAAA;IACH,CAAC,CAAA;IAED,OAAO,eAAe,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA"}
1
+ {"version":3,"file":"whatsapp-media-carousel.js","sourceRoot":"","sources":["../../../src/components/whatsapp-media-carousel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAGrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAsDnC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,EAAE;IACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAE,EAAE;IACzE,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,qCAAqC;QACrC,MAAM,OAAO,GAAG,oDAAoD,CAAA;QACpE,OAAO,CACL,KAAC,OAAO,kBAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,IAAM,KAAK,IAAE,IAAI,EAAE,KAAK,CAAC,IAAI,gBAC3D,OAAO,IACA,CACX,CAAA;IACH,CAAC,CAAA;IAED,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;YAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;aACvB;YACD,MAAA,IAAI,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBACtC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;oBACvB,MAAM,CAAC,WAAW,GAAG,KAAK,CAAA;iBAC3B;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,OAAO,eAAe,CAAC,KAAK,CAAC,CAAA;IAC/B,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO;QACL,gFAAgF;QAChF,kCACM,KAAK,IACT,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,EACrE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAC5C,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EACxC,IAAI,EAAE,KAAK,CAAC,uBAAuB,IACnC,CACH,CAAA;IACH,CAAC,CAAA;IAED,OAAO,eAAe,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA;AACvD,CAAC,CAAA"}
@@ -52,9 +52,17 @@ interface AddBotResponseArgs {
52
52
  interface AddSystemResponseArgs {
53
53
  response: any;
54
54
  }
55
+ export interface MinimalHubtypeMessage {
56
+ id: string;
57
+ type: string;
58
+ action: string;
59
+ text: string;
60
+ }
55
61
  export interface PreviewUtils {
56
62
  getChunkIdsGroupedBySource: (chunkIds: string[]) => Promise<ChunkIdsGroupedBySourceData[]>;
57
63
  onClickOpenChunks: (chunkIdsGroupedBySource: ChunkIdsGroupedBySourceData[]) => void;
64
+ getMessageById: (messageId: string) => Promise<MinimalHubtypeMessage>;
65
+ trackPreviewEventOpened: (eventProperties: Record<string, unknown>) => void;
58
66
  }
59
67
  export interface WebchatArgs {
60
68
  theme?: Partial<WebchatTheme>;
@@ -1 +1 @@
1
- {"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/index-types.ts"],"names":[],"mappings":"AAqJA,MAAM,CAAN,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,4BAAiB,CAAA;AACnB,CAAC,EALW,OAAO,KAAP,OAAO,QAKlB;AAED,MAAM,CAAN,IAAY,MAGX;AAHD,WAAY,MAAM;IAChB,0BAAgB,CAAA;IAChB,4BAAkB,CAAA;AACpB,CAAC,EAHW,MAAM,KAAN,MAAM,QAGjB"}
1
+ {"version":3,"file":"index-types.js","sourceRoot":"","sources":["../../src/index-types.ts"],"names":[],"mappings":"AA8JA,MAAM,CAAN,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,sBAAW,CAAA;IACX,wBAAa,CAAA;IACb,0BAAe,CAAA;IACf,4BAAiB,CAAA;AACnB,CAAC,EALW,OAAO,KAAP,OAAO,QAKlB;AAED,MAAM,CAAN,IAAY,MAGX;AAHD,WAAY,MAAM;IAChB,0BAAgB,CAAA;IAChB,4BAAkB,CAAA;AACpB,CAAC,EAHW,MAAM,KAAN,MAAM,QAGjB"}
@@ -69,6 +69,20 @@ export const WebchatContext = createContext({
69
69
  return;
70
70
  },
71
71
  webchatState: {},
72
+ previewUtils: {
73
+ trackPreviewEventOpened: () => {
74
+ return;
75
+ },
76
+ getChunkIdsGroupedBySource: () => __awaiter(void 0, void 0, void 0, function* () {
77
+ return [];
78
+ }),
79
+ onClickOpenChunks: () => {
80
+ return;
81
+ },
82
+ getMessageById: () => __awaiter(void 0, void 0, void 0, function* () {
83
+ return {};
84
+ }),
85
+ },
72
86
  trackEvent: () => __awaiter(void 0, void 0, void 0, function* () {
73
87
  return;
74
88
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/context/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAKrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAsB;IAC/D,UAAU,EAAE,GAAG,EAAE;QACf,OAAM;IACR,CAAC;IACD,gBAAgB,EAAE,GAAG,EAAE;QACrB,OAAM;IACR,CAAC;IACD,YAAY,EAAE,GAAS,EAAE;QACvB,OAAM;IACR,CAAC,CAAA;IACD,WAAW,EAAE,GAAG,EAAE;QAChB,OAAM;IACR,CAAC;IACD,WAAW,EAAE,GAAG,EAAE;QAChB,OAAM;IACR,CAAC;IACD,mBAAmB,EAAE,GAAG,EAAE;QACxB,OAAM;IACR,CAAC;IACD,iBAAiB,EAAE,GAAG,EAAE;QACtB,OAAM;IACR,CAAC;IACD,qBAAqB,EAAE,GAAG,EAAE;QAC1B,OAAM;IACR,CAAC;IACD,cAAc,EAAE,GAAS,EAAE;QACzB,OAAM;IACR,CAAC,CAAA;IACD,SAAS,EAAE,GAAS,EAAE;QACpB,OAAM;IACR,CAAC,CAAA;IACD,WAAW,EAAE,GAAS,EAAE;QACtB,OAAM;IACR,CAAC,CAAA;IACD,QAAQ,EAAE,GAAS,EAAE;QACnB,OAAM;IACR,CAAC,CAAA;IACD,oBAAoB,EAAE,GAAG,EAAE;QACzB,OAAM;IACR,CAAC;IACD,aAAa,EAAE,GAAG,EAAE;QAClB,OAAM;IACR,CAAC;IACD,iBAAiB,EAAE,GAAG,EAAE;QACtB,OAAM;IACR,CAAC;IACD,oBAAoB,EAAE,GAAG,EAAE;QACzB,OAAM;IACR,CAAC;IACD,wBAAwB,EAAE,GAAG,EAAE;QAC7B,OAAM;IACR,CAAC;IACD,iBAAiB,EAAE,GAAG,EAAE;QACtB,OAAM;IACR,CAAC;IACD,aAAa,EAAE,GAAG,EAAE;QAClB,OAAM;IACR,CAAC;IACD,aAAa,EAAE,GAAG,EAAE;QAClB,OAAM;IACR,CAAC;IACD,UAAU,EAAE,GAAG,EAAE;QACf,OAAM;IACR,CAAC;IACD,wBAAwB,EAAE,GAAG,EAAE;QAC7B,OAAM;IACR,CAAC;IACD,YAAY,EAAE,EAAkB;IAChC,UAAU,EAAE,GAAS,EAAE;QACrB,OAAM;IACR,CAAC,CAAA;IACD,mBAAmB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IACtC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC9B,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAChC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC5B,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC5C,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;CAC9B,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/context/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAOrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAsB;IAC/D,UAAU,EAAE,GAAG,EAAE;QACf,OAAM;IACR,CAAC;IACD,gBAAgB,EAAE,GAAG,EAAE;QACrB,OAAM;IACR,CAAC;IACD,YAAY,EAAE,GAAS,EAAE;QACvB,OAAM;IACR,CAAC,CAAA;IACD,WAAW,EAAE,GAAG,EAAE;QAChB,OAAM;IACR,CAAC;IACD,WAAW,EAAE,GAAG,EAAE;QAChB,OAAM;IACR,CAAC;IACD,mBAAmB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,EAAE,GAAS,EAAE;QACrB,OAAM;IACR,CAAC,CAAA;IACD,mBAAmB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IACtC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC9B,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAChC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC5B,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IAC5C,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;CAC9B,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/react",
3
- "version": "0.41.1-alpha.0",
3
+ "version": "0.42.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "description": "Build Chatbots using React",
6
6
  "main": "./lib/cjs",
@@ -21,7 +21,7 @@
21
21
  "lint_core": "../../node_modules/.bin/eslint_d --cache --quiet '.*.js' '*.js' 'src/**/*.js*' --fix"
22
22
  },
23
23
  "dependencies": {
24
- "@botonic/core": "0.41.1-alpha.0",
24
+ "@botonic/core": "0.42.0-alpha.1",
25
25
  "axios": "^1.12.2",
26
26
  "emoji-picker-react": "^4.12.0",
27
27
  "lodash.merge": "^4.6.2",
@@ -35,7 +35,6 @@ export interface TextProps extends MessageProps {
35
35
 
36
36
  export interface CarouselProps extends MessageProps {
37
37
  children: React.ReactNode[]
38
- text?: string // Only for Whatsapp Interactive Media Carousel
39
38
  }
40
39
 
41
40
  export interface Webview {
@@ -36,10 +36,6 @@ export {
36
36
  WhatsappCTAUrlButtonProps,
37
37
  WhatsappCTAUrlHeaderType,
38
38
  } from './whatsapp-cta-url-button'
39
- export {
40
- WhatsappInteractiveMediaCarousel,
41
- WhatsappInteractiveMediaCarouselProps,
42
- } from './whatsapp-interactive-media-carousel'
43
39
  export {
44
40
  WhatsappMediaCarousel,
45
41
  WhatsappMediaCarouselProps,
@@ -5,7 +5,6 @@ export const WHATSAPP_LIST_MAX_BUTTONS = 10
5
5
  export const WHATSAPP_MAX_BUTTON_CHARS = 20
6
6
  export const WHATSAPP_MAX_HEADER_CHARS = 60
7
7
  export const WHATSAPP_MAX_BODY_CHARS = 1024
8
- export const WHATSAPP_MAX_CAROUSEL_CARD_TEXT_CHARS = 160
9
8
  export const WHATSAPP_MAX_FOOTER_CHARS = 60
10
9
  export const DEFAULT_WHATSAPP_MAX_BUTTON_SEPARATOR = 'More options:'
11
10
  export const MENU_BUTTON_WHATSAPP_BUTTON_LIST = 'Show options'
@@ -1,13 +1,21 @@
1
1
  import { EventAction } from '@botonic/core'
2
- import React, { useRef, useState } from 'react'
2
+ import React, { useContext, useEffect, useRef, useState } from 'react'
3
3
 
4
+ import { WebchatContext } from '../../webchat/context'
4
5
  import {
5
6
  getAiAgentEventConfig,
7
+ getBotActionEventConfig,
8
+ getConditionalChannelEventConfig,
9
+ getConditionalCountryEventConfig,
10
+ getConditionalCustomEventConfig,
11
+ getConditionalQueueStatusEventConfig,
6
12
  getFallbackEventConfig,
7
13
  getHandoffSuccessEventConfig,
8
14
  getKeywordEventConfig,
9
15
  getKnowledgeBaseEventConfig,
16
+ getRedirectFlowEventConfig,
10
17
  getSmartIntentEventConfig,
18
+ getWebviewActionTriggeredEventConfig,
11
19
  } from './events'
12
20
  import { useLastLabelPosition } from './hooks/use-last-label-position'
13
21
  import { CaretDownSvg, CaretUpSvg } from './icons'
@@ -38,6 +46,20 @@ const getEventConfig = (
38
46
  return getKnowledgeBaseEventConfig(debugEvent)
39
47
  case EventAction.Fallback:
40
48
  return getFallbackEventConfig(debugEvent)
49
+ case EventAction.BotAction:
50
+ return getBotActionEventConfig(debugEvent)
51
+ case EventAction.ConditionalChannel:
52
+ return getConditionalChannelEventConfig(debugEvent)
53
+ case EventAction.ConditionalCountry:
54
+ return getConditionalCountryEventConfig(debugEvent)
55
+ case EventAction.ConditionalCustom:
56
+ return getConditionalCustomEventConfig(debugEvent)
57
+ case EventAction.ConditionalQueueStatus:
58
+ return getConditionalQueueStatusEventConfig(debugEvent)
59
+ case EventAction.RedirectFlow:
60
+ return getRedirectFlowEventConfig(debugEvent)
61
+ case EventAction.WebviewActionTriggered:
62
+ return getWebviewActionTriggeredEventConfig(debugEvent)
41
63
  default:
42
64
  return undefined
43
65
  }
@@ -51,7 +73,7 @@ interface DebugMessageProps {
51
73
  export const DebugMessage = ({ debugEvent, messageId }: DebugMessageProps) => {
52
74
  const [isExpanded, setIsExpanded] = useState(false)
53
75
  const wrapperRef = useRef<HTMLDivElement>(null)
54
-
76
+ const { previewUtils } = useContext(WebchatContext)
55
77
  const eventConfig = getEventConfig(debugEvent)
56
78
 
57
79
  useLastLabelPosition({
@@ -61,6 +83,12 @@ export const DebugMessage = ({ debugEvent, messageId }: DebugMessageProps) => {
61
83
  isCollapsible: eventConfig?.collapsible ?? false,
62
84
  })
63
85
 
86
+ useEffect(() => {
87
+ if (isExpanded) {
88
+ previewUtils?.trackPreviewEventOpened?.({ action: debugEvent.action })
89
+ }
90
+ }, [previewUtils, isExpanded, debugEvent])
91
+
64
92
  if (!eventConfig) {
65
93
  return null
66
94
  }
@@ -0,0 +1,28 @@
1
+ import { EventAction } from '@botonic/core'
2
+ import React from 'react'
3
+
4
+ import { CodeSvg } from '../icons/code'
5
+ import { DebugEventConfig } from '../types'
6
+
7
+ export interface BotActionDebugEvent {
8
+ action: EventAction.BotAction
9
+ payload: string
10
+ }
11
+
12
+ export const getBotActionEventConfig = (
13
+ data: BotActionDebugEvent
14
+ ): DebugEventConfig => {
15
+ const title = (
16
+ <>
17
+ Bot action triggered <span>- {data.payload}</span>
18
+ </>
19
+ )
20
+
21
+ return {
22
+ action: EventAction.BotAction,
23
+ title,
24
+ component: null,
25
+ icon: <CodeSvg />,
26
+ collapsible: false,
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ import { EventAction } from '@botonic/core'
2
+ import React from 'react'
3
+
4
+ import { SplitSvg } from '../icons/split'
5
+ import { DebugEventConfig } from '../types'
6
+
7
+ export interface ConditionalChannelDebugEvent {
8
+ action: EventAction.ConditionalChannel
9
+ channel: string
10
+ }
11
+
12
+ export const getConditionalChannelEventConfig = (
13
+ data: ConditionalChannelDebugEvent
14
+ ): DebugEventConfig => {
15
+ const title = (
16
+ <>
17
+ Channel checked <span>- {data.channel}</span>
18
+ </>
19
+ )
20
+
21
+ return {
22
+ action: EventAction.ConditionalChannel,
23
+ title,
24
+ component: null,
25
+ icon: <SplitSvg />,
26
+ collapsible: false,
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ import { EventAction } from '@botonic/core'
2
+ import React from 'react'
3
+
4
+ import { SplitSvg } from '../icons/split'
5
+ import { DebugEventConfig } from '../types'
6
+
7
+ export interface ConditionalCountryDebugEvent {
8
+ action: EventAction.ConditionalCountry
9
+ country: string
10
+ }
11
+
12
+ export const getConditionalCountryEventConfig = (
13
+ data: ConditionalCountryDebugEvent
14
+ ): DebugEventConfig => {
15
+ const title = (
16
+ <>
17
+ Country checked <span>- {data.country}</span>
18
+ </>
19
+ )
20
+
21
+ return {
22
+ action: EventAction.ConditionalCountry,
23
+ title,
24
+ component: null,
25
+ icon: <SplitSvg />,
26
+ collapsible: false,
27
+ }
28
+ }
@@ -0,0 +1,29 @@
1
+ import { EventAction } from '@botonic/core'
2
+ import React from 'react'
3
+
4
+ import { SplitSvg } from '../icons/split'
5
+ import { DebugEventConfig } from '../types'
6
+
7
+ export interface ConditionalCustomDebugEvent {
8
+ action: EventAction.ConditionalCustom
9
+ conditional_variable: string
10
+ variable_format: string
11
+ }
12
+
13
+ export const getConditionalCustomEventConfig = (
14
+ data: ConditionalCustomDebugEvent
15
+ ): DebugEventConfig => {
16
+ const title = (
17
+ <>
18
+ Custom condition checked <span>- {data.conditional_variable}</span>
19
+ </>
20
+ )
21
+
22
+ return {
23
+ action: EventAction.ConditionalCustom,
24
+ title,
25
+ component: null,
26
+ icon: <SplitSvg />,
27
+ collapsible: false,
28
+ }
29
+ }
@@ -0,0 +1,37 @@
1
+ import { EventAction } from '@botonic/core'
2
+ import React from 'react'
3
+
4
+ import { SplitSvg } from '../icons/split'
5
+ import { DebugEventConfig } from '../types'
6
+
7
+ export interface ConditionalQueueStatusDebugEvent {
8
+ action: EventAction.ConditionalQueueStatus
9
+ queue_id: string
10
+ queue_name: string
11
+ is_queue_open: boolean
12
+ is_available_agent: boolean
13
+ }
14
+
15
+ export const getConditionalQueueStatusEventConfig = (
16
+ data: ConditionalQueueStatusDebugEvent
17
+ ): DebugEventConfig => {
18
+ const queueStatus = data.is_queue_open ? 'Open' : 'Closed'
19
+ const agentStatus = data.is_available_agent ? 'Available' : 'Unavailable'
20
+
21
+ const title = (
22
+ <>
23
+ Queue status checked{' '}
24
+ <span>
25
+ - {queueStatus} (Agent {agentStatus})
26
+ </span>
27
+ </>
28
+ )
29
+
30
+ return {
31
+ action: EventAction.ConditionalQueueStatus,
32
+ title,
33
+ component: null,
34
+ icon: <SplitSvg />,
35
+ collapsible: false,
36
+ }
37
+ }
@@ -7,9 +7,13 @@ export const LABELS = {
7
7
  KNOWLEDGE_GATHERED: 'Knowledge gathered',
8
8
  EXECUTED_TOOLS: 'Executed tools',
9
9
  NO_TOOLS_EXECUTED: 'No tools executed',
10
+ AUTO_ASSIGN_ON: 'ON',
11
+ AUTO_ASSIGN_OFF: 'OFF',
10
12
  EXIT: 'Exit',
11
13
  ERROR: 'Error',
12
14
  QUEUE: 'Queue',
15
+ AUTO_ASSIGN: 'Auto-assign',
16
+ NOTE: 'Note',
13
17
  KNOWLEDGE_BASE_FAIL_REASON: 'Knowledge Base Fail Reason',
14
18
  SEE_CHUNKS_BUTTON: 'See chunks',
15
19
  } as const
@@ -1,6 +1,7 @@
1
1
  import { EventAction } from '@botonic/core'
2
- import React from 'react'
2
+ import React, { useContext, useEffect, useState } from 'react'
3
3
 
4
+ import { WebchatContext } from '../../../webchat/context'
4
5
  import { HeadSetSvg } from '../icons'
5
6
  import {
6
7
  StyledDebugDetail,
@@ -14,14 +15,51 @@ export interface HandoffSuccessDebugEvent {
14
15
  action: EventAction.HandoffSuccess
15
16
  handoff_queue_name: string
16
17
  handoff_is_queue_open: boolean
18
+ handoff_has_auto_assign: boolean
19
+ handoff_note_id: string
17
20
  }
18
21
 
19
22
  export const HandoffSuccess = (props: HandoffSuccessDebugEvent) => {
23
+ const { previewUtils } = useContext(WebchatContext)
24
+ const [noteMessage, setNoteMessage] = useState<string>()
25
+
26
+ useEffect(() => {
27
+ const fetchNoteMessage = async () => {
28
+ if (!previewUtils || !props.handoff_note_id) {
29
+ return
30
+ }
31
+ const noteMessage = await previewUtils.getMessageById(
32
+ props.handoff_note_id
33
+ )
34
+ if (!noteMessage) {
35
+ return
36
+ }
37
+ setNoteMessage(noteMessage.text)
38
+ }
39
+ fetchNoteMessage()
40
+ }, [previewUtils, props.handoff_note_id])
41
+
20
42
  return (
21
- <StyledDebugDetail>
22
- <StyledDebugLabel>{LABELS.QUEUE}</StyledDebugLabel>
23
- <StyledDebugValue>{props.handoff_queue_name}</StyledDebugValue>
24
- </StyledDebugDetail>
43
+ <>
44
+ <StyledDebugDetail>
45
+ <StyledDebugLabel>{LABELS.QUEUE}</StyledDebugLabel>
46
+ <StyledDebugValue>{props.handoff_queue_name}</StyledDebugValue>
47
+ </StyledDebugDetail>
48
+ <StyledDebugDetail>
49
+ <StyledDebugLabel>{LABELS.AUTO_ASSIGN}</StyledDebugLabel>
50
+ <StyledDebugValue>
51
+ {props.handoff_has_auto_assign
52
+ ? LABELS.AUTO_ASSIGN_ON
53
+ : LABELS.AUTO_ASSIGN_OFF}
54
+ </StyledDebugValue>
55
+ </StyledDebugDetail>
56
+ {Boolean(noteMessage) && (
57
+ <StyledDebugDetail>
58
+ <StyledDebugLabel>{LABELS.NOTE}</StyledDebugLabel>
59
+ <StyledDebugValue>{noteMessage}</StyledDebugValue>
60
+ </StyledDebugDetail>
61
+ )}
62
+ </>
25
63
  )
26
64
  }
27
65
 
@@ -36,8 +74,7 @@ export const getHandoffSuccessEventConfig = (
36
74
  </>
37
75
  ),
38
76
  icon: <HeadSetSvg />,
39
- // TODO: Disable component and collapsible for now because we are only showing the queue name
40
- component: null,
41
- collapsible: false,
77
+ component: HandoffSuccess,
78
+ collapsible: true,
42
79
  }
43
80
  }
@@ -1,7 +1,14 @@
1
1
  export * from './ai-agent'
2
+ export * from './bot-action'
3
+ export * from './conditional-channel'
4
+ export * from './conditional-country'
5
+ export * from './conditional-custom'
6
+ export * from './conditional-queue-status'
2
7
  export * from './fallback'
3
8
  export * from './handoff-success'
4
9
  export * from './keyword'
5
10
  export * from './knowledge-base'
6
11
  export * from './knowledge-bases-types'
12
+ export * from './redirect-flow'
7
13
  export * from './smart-intent'
14
+ export * from './webview-action-triggered'
@@ -0,0 +1,31 @@
1
+ import { EventAction } from '@botonic/core'
2
+ import React from 'react'
3
+
4
+ import { ArrowProgressSvg } from '../icons/arrow-progress'
5
+ import { DebugEventConfig } from '../types'
6
+
7
+ export interface RedirectFlowDebugEvent {
8
+ action: EventAction.RedirectFlow
9
+ flow_id: string
10
+ flow_name: string
11
+ flow_target_id: string
12
+ flow_target_name: string
13
+ }
14
+
15
+ export const getRedirectFlowEventConfig = (
16
+ data: RedirectFlowDebugEvent
17
+ ): DebugEventConfig => {
18
+ const title = (
19
+ <>
20
+ Redirected to flow <span>- {data.flow_target_name}</span>
21
+ </>
22
+ )
23
+
24
+ return {
25
+ action: EventAction.RedirectFlow,
26
+ title,
27
+ component: null,
28
+ icon: <ArrowProgressSvg />,
29
+ collapsible: false,
30
+ }
31
+ }