@ibti-tech/chatbot 0.8.1 → 0.8.6
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/README.md +9 -1
- package/dist/index.d.ts +41 -19
- package/dist/index.mjs +86 -62
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,9 +60,17 @@ All public types (e.g. `ChatbotTypes`, `ChatbotBarProps`) and parameters are doc
|
|
|
60
60
|
| `horizontalPosition` | `'left' \| 'right'` | `'right'` | Bar alignment |
|
|
61
61
|
| `deviceHorizontalPosition`| `'left' \| 'right' \| 'center' \| string` | — | Device position on desktop (or e.g. `'20px'`, `'calc(100% - 200px)'`) |
|
|
62
62
|
| `pushContentDown` | `boolean` | `false` | If `true` and `verticalPosition="top"`, widget pushes content down instead of overlaying |
|
|
63
|
+
| `pushContentDownBarHeight`| `number` | `32` | Height in px of the bar when pushContentDown (24–120). |
|
|
63
64
|
| `zIndex`, `topOffset`, `aboveHeader` | — | — | Optional layout/stacking |
|
|
64
65
|
|
|
65
|
-
When using `pushContentDown={true}` with `verticalPosition="top"`,
|
|
66
|
+
When using `pushContentDown={true}` with `verticalPosition="top"`, the bar is fixed at the top and the widget adds the class `ibti-chatbot-push-down` and CSS variable `--ibti-chatbot-bar-height` (default 32px) to `body`. To avoid extra vertical scroll and keep your content below the bar, reserve the top space in your layout, for example:
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
body.ibti-chatbot-push-down .your-main-content {
|
|
70
|
+
padding-top: var(--ibti-chatbot-bar-height, 32px);
|
|
71
|
+
min-height: calc(100vh - var(--ibti-chatbot-bar-height, 32px));
|
|
72
|
+
}
|
|
73
|
+
```
|
|
66
74
|
|
|
67
75
|
### Types (`ChatbotTypes`)
|
|
68
76
|
|
package/dist/index.d.ts
CHANGED
|
@@ -85,12 +85,16 @@ declare module '@ibti-tech/chatbot/components/ChatbotBar/index' {
|
|
|
85
85
|
pushContentDownRowBackgroundLight?: string;
|
|
86
86
|
/** Background of the push-content-down full-width row (dark theme). Hex or rgb(). Default: rgb(0, 0, 0). */
|
|
87
87
|
pushContentDownRowBackgroundDark?: string;
|
|
88
|
+
/** Height in px of the bar when pushContentDown is true (closed state). Default: 32. */
|
|
89
|
+
pushContentDownBarHeight?: number;
|
|
88
90
|
};
|
|
89
|
-
|
|
91
|
+
/** Bar height in px when pushContentDown (closed state). Used for body class and CSS variable. */
|
|
92
|
+
export const PUSH_DOWN_BAR_HEIGHT_PX = 32;
|
|
93
|
+
export const ChatbotBar: ({ verticalPosition, horizontalPosition, deviceHorizontalPosition, zIndex, topOffset, aboveHeader, pushContentDown, pushContentDownRowBackgroundLight, pushContentDownRowBackgroundDark, pushContentDownBarHeight, }: ChatbotBarProps) => React.JSX.Element;
|
|
90
94
|
//# sourceMappingURL=index.d.ts.map
|
|
91
95
|
}
|
|
92
96
|
declare module '@ibti-tech/chatbot/components/ChatbotBar/index.d.ts' {
|
|
93
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotBar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACrC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC/D,2GAA2G;IAC3G,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sIAAsI;IACtI,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,wGAAwG;IACxG,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mHAAmH;IACnH,iCAAiC,CAAC,EAAE,MAAM,CAAA;IAC1C,4GAA4G;IAC5G,gCAAgC,CAAC,EAAE,MAAM,CAAA;
|
|
97
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotBar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACrC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC/D,2GAA2G;IAC3G,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sIAAsI;IACtI,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,wGAAwG;IACxG,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mHAAmH;IACnH,iCAAiC,CAAC,EAAE,MAAM,CAAA;IAC1C,4GAA4G;IAC5G,gCAAgC,CAAC,EAAE,MAAM,CAAA;IACzC,wFAAwF;IACxF,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAKD,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,KAAK,CAAA;AAKzC,eAAO,MAAM,UAAU,GAAI,qNAWxB,eAAe,sBAgGjB,CAAA"}
|
|
94
98
|
}
|
|
95
99
|
declare module '@ibti-tech/chatbot/components/ChatbotBar/styles' {
|
|
96
100
|
import { breakpoints } from '@ibti-tech/ui';
|
|
@@ -107,6 +111,7 @@ declare module '@ibti-tech/chatbot/components/ChatbotBar/styles' {
|
|
|
107
111
|
/** Full-width row strip (pushContentDown + top). Background only; device sits on top with theme styles. */
|
|
108
112
|
export const PushDownRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
109
113
|
$background: string;
|
|
114
|
+
$barHeight: number;
|
|
110
115
|
}>> & string;
|
|
111
116
|
export const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
112
117
|
$verticalPosition: "top" | "bottom";
|
|
@@ -116,11 +121,12 @@ declare module '@ibti-tech/chatbot/components/ChatbotBar/styles' {
|
|
|
116
121
|
$topOffset?: string | number;
|
|
117
122
|
$aboveHeader?: boolean;
|
|
118
123
|
$pushContentDown?: boolean;
|
|
124
|
+
$pushContentDownBarHeight?: number;
|
|
119
125
|
}>> & string;
|
|
120
126
|
//# sourceMappingURL=styles.d.ts.map
|
|
121
127
|
}
|
|
122
128
|
declare module '@ibti-tech/chatbot/components/ChatbotBar/styles.d.ts' {
|
|
123
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotBar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAW,MAAM,eAAe,CAAA;AAIpD,eAAO,MAAM,YAAY;;oBAEgB,kBAAmB;;yBADrC,MAAM,GAAG,OAAO;gCACT,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;aACvD,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;iMA4E3B,CAAA;AAED,2GAA2G;AAC3G,eAAO,MAAM,WAAW;iBAA6B,MAAM;
|
|
129
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotBar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAW,MAAM,eAAe,CAAA;AAIpD,eAAO,MAAM,YAAY;;oBAEgB,kBAAmB;;yBADrC,MAAM,GAAG,OAAO;gCACT,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;aACvD,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;iMA4E3B,CAAA;AAED,2GAA2G;AAC3G,eAAO,MAAM,WAAW;iBAA6B,MAAM;gBAAc,MAAM;YAS9E,CAAA;AAED,eAAO,MAAM,OAAO;uBACC,KAAK,GAAG,QAAQ;yBACd,MAAM,GAAG,OAAO;aAC5B,OAAO;cACN,MAAM;iBACH,MAAM,GAAG,MAAM;mBACb,OAAO;uBACH,OAAO;gCACE,MAAM;YAgInC,CAAA"}
|
|
124
130
|
}
|
|
125
131
|
declare module '@ibti-tech/chatbot/components/ChatbotBody/index' {
|
|
126
132
|
import React from 'react';
|
|
@@ -153,13 +159,15 @@ declare module '@ibti-tech/chatbot/components/ChatbotDevice/index' {
|
|
|
153
159
|
* Default: undefined (uses parent container positioning)
|
|
154
160
|
*/
|
|
155
161
|
horizontalPosition?: 'left' | 'right' | 'center' | string;
|
|
162
|
+
/** Height in px of the bar when pushContentDown (closed state). Default: 32. */
|
|
163
|
+
pushContentDownBarHeight?: number;
|
|
156
164
|
};
|
|
157
|
-
export const ChatbotDevice: ({ verticalPosition, pushContentDown, horizontalPosition, }: ChatbotDeviceProps) => React.JSX.Element;
|
|
165
|
+
export const ChatbotDevice: ({ verticalPosition, pushContentDown, horizontalPosition, pushContentDownBarHeight, }: ChatbotDeviceProps) => React.JSX.Element;
|
|
158
166
|
export default ChatbotDevice;
|
|
159
167
|
//# sourceMappingURL=index.d.ts.map
|
|
160
168
|
}
|
|
161
169
|
declare module '@ibti-tech/chatbot/components/ChatbotDevice/index.d.ts' {
|
|
162
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotDevice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;
|
|
170
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotDevice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IACzD,gFAAgF;IAChF,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAID,eAAO,MAAM,aAAa,GAAI,sFAK3B,kBAAkB,sBAyBpB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
163
171
|
}
|
|
164
172
|
declare module '@ibti-tech/chatbot/components/ChatbotDevice/styles' {
|
|
165
173
|
export const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
@@ -167,11 +175,12 @@ declare module '@ibti-tech/chatbot/components/ChatbotDevice/styles' {
|
|
|
167
175
|
$verticalPosition: "top" | "bottom";
|
|
168
176
|
$pushContentDown?: boolean;
|
|
169
177
|
$horizontalPosition?: "left" | "right" | "center" | string;
|
|
178
|
+
$pushContentDownBarHeight?: number;
|
|
170
179
|
}>> & string;
|
|
171
180
|
//# sourceMappingURL=styles.d.ts.map
|
|
172
181
|
}
|
|
173
182
|
declare module '@ibti-tech/chatbot/components/ChatbotDevice/styles.d.ts' {
|
|
174
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotDevice/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;aACT,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;0BACJ,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;
|
|
183
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotDevice/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;aACT,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;0BACJ,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;gCAC9B,MAAM;YAyOnC,CAAA"}
|
|
175
184
|
}
|
|
176
185
|
declare module '@ibti-tech/chatbot/components/ChatbotFooter/index' {
|
|
177
186
|
import React from 'react';
|
|
@@ -240,13 +249,15 @@ declare module '@ibti-tech/chatbot/components/ChatbotToggle/index' {
|
|
|
240
249
|
verticalPosition?: 'top' | 'bottom';
|
|
241
250
|
opened?: boolean;
|
|
242
251
|
pushContentDown?: boolean;
|
|
252
|
+
/** Height in px of the bar when closed (pushContentDown or bottom). Default: 32. */
|
|
253
|
+
pushContentDownBarHeight?: number;
|
|
243
254
|
};
|
|
244
|
-
export const ChatbotToggle: ({ verticalPosition, opened: openedProp, pushContentDown, }: ChatbotToggleProps) => React.JSX.Element;
|
|
255
|
+
export const ChatbotToggle: ({ verticalPosition, opened: openedProp, pushContentDown, pushContentDownBarHeight, }: ChatbotToggleProps) => React.JSX.Element;
|
|
245
256
|
export default ChatbotToggle;
|
|
246
257
|
//# sourceMappingURL=index.d.ts.map
|
|
247
258
|
}
|
|
248
259
|
declare module '@ibti-tech/chatbot/components/ChatbotToggle/index.d.ts' {
|
|
249
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotToggle/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;
|
|
260
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotToggle/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,oFAAoF;IACpF,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAID,eAAO,MAAM,aAAa,GAAI,sFAK3B,kBAAkB,sBAmCpB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
250
261
|
}
|
|
251
262
|
declare module '@ibti-tech/chatbot/components/ChatbotToggle/styles' {
|
|
252
263
|
export const ButtonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
@@ -254,11 +265,12 @@ declare module '@ibti-tech/chatbot/components/ChatbotToggle/styles' {
|
|
|
254
265
|
$verticalPosition: "top" | "bottom";
|
|
255
266
|
$pushContentDown?: boolean;
|
|
256
267
|
$themeMode?: "light" | "dark";
|
|
268
|
+
$barHeight?: number;
|
|
257
269
|
}>> & string;
|
|
258
270
|
//# sourceMappingURL=styles.d.ts.map
|
|
259
271
|
}
|
|
260
272
|
declare module '@ibti-tech/chatbot/components/ChatbotToggle/styles.d.ts' {
|
|
261
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotToggle/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;aACf,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;iBACb,OAAO,GAAG,MAAM;
|
|
273
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotToggle/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;aACf,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;iBACb,OAAO,GAAG,MAAM;iBAChB,MAAM;YAwEpB,CAAA"}
|
|
262
274
|
}
|
|
263
275
|
declare module '@ibti-tech/chatbot/components/MessageBalloon/index' {
|
|
264
276
|
import React from 'react';
|
|
@@ -456,7 +468,7 @@ declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatFeedbackBox' {
|
|
|
456
468
|
};
|
|
457
469
|
/**
|
|
458
470
|
* Hook for the feedback modal: open/close and send rating.
|
|
459
|
-
* Uses useChatbot() for apiURL, locale,
|
|
471
|
+
* Uses useChatbot() for apiURL, locale, publicHash, visitorId.
|
|
460
472
|
*
|
|
461
473
|
* @returns { opened, open, close, sendUserRating, loading } — loading true while submit in progress
|
|
462
474
|
*/
|
|
@@ -471,7 +483,7 @@ declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatFeedbackBox' {
|
|
|
471
483
|
//# sourceMappingURL=useChatFeedbackBox.d.ts.map
|
|
472
484
|
}
|
|
473
485
|
declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatFeedbackBox.d.ts' {
|
|
474
|
-
{"version":3,"file":"useChatFeedbackBox.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/contexts/Chatbot/useChatFeedbackBox.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,KAAK,mBAAmB,GAAG;IACzB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;oDAkB1B,mBAAmB;;
|
|
486
|
+
{"version":3,"file":"useChatFeedbackBox.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/contexts/Chatbot/useChatFeedbackBox.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,KAAK,mBAAmB,GAAG;IACzB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;oDAkB1B,mBAAmB;;CAyBvB,CAAA"}
|
|
475
487
|
}
|
|
476
488
|
declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatbot' {
|
|
477
489
|
/**
|
|
@@ -632,6 +644,18 @@ declare module '@ibti-tech/chatbot/embed' {
|
|
|
632
644
|
icon?: string;
|
|
633
645
|
/** Custom UI texts per locale: { 'pt-BR': CustomTexts, 'en': CustomTexts }. */
|
|
634
646
|
texts?: ChatbotTypes.Texts;
|
|
647
|
+
/** When true and position is top-*, the bar pushes page content down (no overlay). Avoids extra scroll when combined with body class .ibti-chatbot-push-down. */
|
|
648
|
+
pushContentDown?: boolean;
|
|
649
|
+
/** Offset from top (e.g. '64px', 80). Use to sit below a fixed header. */
|
|
650
|
+
topOffset?: string | number;
|
|
651
|
+
/** When true, sets z-index to 9999 so the chatbot appears above header elements. */
|
|
652
|
+
aboveHeader?: boolean;
|
|
653
|
+
/** Bar background when pushContentDown (light theme). Default rgb(230,230,230). */
|
|
654
|
+
pushContentDownRowBackgroundLight?: string;
|
|
655
|
+
/** Bar background when pushContentDown (dark theme). Default rgb(0,0,0). */
|
|
656
|
+
pushContentDownRowBackgroundDark?: string;
|
|
657
|
+
/** Height in px of the bar when pushContentDown is true. Default: 32. Clamped between 24 and 120. */
|
|
658
|
+
pushContentDownBarHeight?: number;
|
|
635
659
|
}
|
|
636
660
|
global {
|
|
637
661
|
interface Window {
|
|
@@ -646,7 +670,7 @@ declare module '@ibti-tech/chatbot/embed' {
|
|
|
646
670
|
//# sourceMappingURL=embed.d.ts.map
|
|
647
671
|
}
|
|
648
672
|
declare module '@ibti-tech/chatbot/embed.d.ts' {
|
|
649
|
-
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/embed.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,YAAY,CAAC,MAAM,CAAA;IAC5B,iDAAiD;IACjD,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAA;IACpE,uHAAuH;IACvH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,oFAAoF;IACpF,MAAM,CAAC,EAAE,YAAY,CAAC,YAAY,CAAA;IAClC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+EAA+E;IAC/E,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;
|
|
673
|
+
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/embed.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,YAAY,CAAC,MAAM,CAAA;IAC5B,iDAAiD;IACjD,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAA;IACpE,uHAAuH;IACvH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,oFAAoF;IACpF,MAAM,CAAC,EAAE,YAAY,CAAC,YAAY,CAAA;IAClC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+EAA+E;IAC/E,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAC1B,iKAAiK;IACjK,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,oFAAoF;IACpF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mFAAmF;IACnF,iCAAiC,CAAC,EAAE,MAAM,CAAA;IAC1C,4EAA4E;IAC5E,gCAAgC,CAAC,EAAE,MAAM,CAAA;IACzC,qGAAqG;IACrG,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,CAAC,EAAE,sBAAsB,CAAA;QAC1C,gBAAgB,CAAC,EAAE;YACjB,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,sBAAsB,KAAK,IAAI,CAAA;YAC/C,OAAO,EAAE,MAAM,IAAI,CAAA;SACpB,CAAA;KACF;CACF;AAmJD,wBAAgB,UAAU,SAEzB"}
|
|
650
674
|
}
|
|
651
675
|
declare module '@ibti-tech/chatbot/events/assistant-answer' {
|
|
652
676
|
export const dispatchAssitantAnswer: () => void;
|
|
@@ -926,16 +950,16 @@ declare module '@ibti-tech/chatbot/services/feedback/feedback.api' {
|
|
|
926
950
|
/**
|
|
927
951
|
* Sends user feedback (rating) for the current chat session.
|
|
928
952
|
* Endpoint: POST /chat/feedback
|
|
929
|
-
* Body: locale, rating_score,
|
|
953
|
+
* Body: hash, visitorId, locale, rating_score, message (optional). API resolves conversation by hash + visitorId.
|
|
930
954
|
*
|
|
931
|
-
* @param params - SendUserChatFeedbackParams: apiURL, locale,
|
|
955
|
+
* @param params - SendUserChatFeedbackParams: apiURL, locale, ratingScore, optional description, publicHash, visitorId
|
|
932
956
|
* @returns Promise resolving to the fetch Response; check response.ok for success
|
|
933
957
|
*/
|
|
934
|
-
export const sendUserChatFeedback: ({ apiURL,
|
|
958
|
+
export const sendUserChatFeedback: ({ apiURL, locale, ratingScore, description, publicHash, visitorId, }: SendUserChatFeedbackParams) => Promise<Response>;
|
|
935
959
|
//# sourceMappingURL=feedback.api.d.ts.map
|
|
936
960
|
}
|
|
937
961
|
declare module '@ibti-tech/chatbot/services/feedback/feedback.api.d.ts' {
|
|
938
|
-
{"version":3,"file":"feedback.api.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/feedback/feedback.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAU,
|
|
962
|
+
{"version":3,"file":"feedback.api.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/feedback/feedback.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAU,sEAOxC,0BAA0B,KAAG,OAAO,CAAC,QAAQ,CAY/C,CAAA"}
|
|
939
963
|
}
|
|
940
964
|
declare module '@ibti-tech/chatbot/services/index' {
|
|
941
965
|
/**
|
|
@@ -1016,8 +1040,6 @@ declare module '@ibti-tech/chatbot/services/types/feedback.types' {
|
|
|
1016
1040
|
publicHash?: string;
|
|
1017
1041
|
/** Optional. Visitor id to associate feedback with the conversation. */
|
|
1018
1042
|
visitorId?: string;
|
|
1019
|
-
/** Current conversation context (role + content) for the session being rated. */
|
|
1020
|
-
chatContext: Pick<ChatbotTypes.ChatMessage, 'content' | 'role'>[];
|
|
1021
1043
|
/** Rating score (e.g. 1–5). */
|
|
1022
1044
|
ratingScore: number;
|
|
1023
1045
|
/** Optional. Free-text feedback. */
|
|
@@ -1026,7 +1048,7 @@ declare module '@ibti-tech/chatbot/services/types/feedback.types' {
|
|
|
1026
1048
|
//# sourceMappingURL=feedback.types.d.ts.map
|
|
1027
1049
|
}
|
|
1028
1050
|
declare module '@ibti-tech/chatbot/services/types/feedback.types.d.ts' {
|
|
1029
|
-
{"version":3,"file":"feedback.types.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/types/feedback.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEpC;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,kCAAkC;IAClC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAA;IAC3B,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB
|
|
1051
|
+
{"version":3,"file":"feedback.types.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/types/feedback.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEpC;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,kCAAkC;IAClC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAA;IAC3B,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
1030
1052
|
}
|
|
1031
1053
|
declare module '@ibti-tech/chatbot/services/types/index' {
|
|
1032
1054
|
export * from '@ibti-tech/chatbot/services/types/chat.types';
|
package/dist/index.mjs
CHANGED
|
@@ -279,7 +279,6 @@ var getWelcomeMessage = /* @__PURE__ */ __name(async (apiUrl, locale = "en", pub
|
|
|
279
279
|
// src/services/feedback/feedback.api.ts
|
|
280
280
|
var sendUserChatFeedback = /* @__PURE__ */ __name(async ({
|
|
281
281
|
apiURL,
|
|
282
|
-
chatContext,
|
|
283
282
|
locale = "en",
|
|
284
283
|
ratingScore,
|
|
285
284
|
description,
|
|
@@ -292,7 +291,6 @@ var sendUserChatFeedback = /* @__PURE__ */ __name(async ({
|
|
|
292
291
|
body: JSON.stringify({
|
|
293
292
|
locale,
|
|
294
293
|
rating_score: ratingScore,
|
|
295
|
-
chat_context: chatContext,
|
|
296
294
|
message: description,
|
|
297
295
|
...publicHash && { hash: publicHash },
|
|
298
296
|
...visitorId && { visitorId }
|
|
@@ -1019,10 +1017,11 @@ var Wrapper = styled.div`
|
|
|
1019
1017
|
|
|
1020
1018
|
/* Default height - will be overridden by specific states */
|
|
1021
1019
|
${(props) => {
|
|
1020
|
+
const barH = props.$pushContentDownBarHeight ?? 32;
|
|
1022
1021
|
if (props.$pushContentDown && props.$verticalPosition === "top") {
|
|
1023
1022
|
if (!props.$opened) {
|
|
1024
1023
|
return css`
|
|
1025
|
-
height:
|
|
1024
|
+
height: ${barH}px;
|
|
1026
1025
|
`;
|
|
1027
1026
|
}
|
|
1028
1027
|
return css`
|
|
@@ -1080,12 +1079,13 @@ var Wrapper = styled.div`
|
|
|
1080
1079
|
${screens.tablet} {
|
|
1081
1080
|
/* Height when closed with pushContentDown vs opened */
|
|
1082
1081
|
${(props) => {
|
|
1082
|
+
const barH = props.$pushContentDownBarHeight ?? 32;
|
|
1083
1083
|
if (props.$pushContentDown && props.$verticalPosition === "top") {
|
|
1084
1084
|
if (!props.$opened) {
|
|
1085
1085
|
return css`
|
|
1086
|
-
height:
|
|
1087
|
-
max-height:
|
|
1088
|
-
min-height:
|
|
1086
|
+
height: ${barH}px !important;
|
|
1087
|
+
max-height: ${barH}px !important;
|
|
1088
|
+
min-height: ${barH}px !important;
|
|
1089
1089
|
`;
|
|
1090
1090
|
} else {
|
|
1091
1091
|
return css`
|
|
@@ -1131,18 +1131,20 @@ var Wrapper = styled.div`
|
|
|
1131
1131
|
}
|
|
1132
1132
|
|
|
1133
1133
|
/* Closed state styles */
|
|
1134
|
-
${(props) =>
|
|
1134
|
+
${(props) => {
|
|
1135
|
+
const barH = props.$pushContentDownBarHeight ?? 32;
|
|
1136
|
+
return !props.$opened && (props.$verticalPosition === "top" ? css`
|
|
1135
1137
|
${props.$pushContentDown ? css`
|
|
1136
1138
|
/* Push content down mode: show only toggle button - based on commit 8379cc8 */
|
|
1137
|
-
height:
|
|
1138
|
-
max-height:
|
|
1139
|
-
min-height:
|
|
1139
|
+
height: ${barH}px !important;
|
|
1140
|
+
max-height: ${barH}px !important;
|
|
1141
|
+
min-height: ${barH}px !important;
|
|
1140
1142
|
transform: none !important;
|
|
1141
1143
|
overflow: visible !important;
|
|
1142
1144
|
${screens.tablet} {
|
|
1143
|
-
height:
|
|
1144
|
-
max-height:
|
|
1145
|
-
min-height:
|
|
1145
|
+
height: ${barH}px !important;
|
|
1146
|
+
max-height: ${barH}px !important;
|
|
1147
|
+
min-height: ${barH}px !important;
|
|
1146
1148
|
transform: none !important;
|
|
1147
1149
|
}
|
|
1148
1150
|
> *:not(:last-child) {
|
|
@@ -1150,9 +1152,9 @@ var Wrapper = styled.div`
|
|
|
1150
1152
|
}
|
|
1151
1153
|
> *:last-child {
|
|
1152
1154
|
flex-shrink: 0 !important;
|
|
1153
|
-
min-height:
|
|
1154
|
-
height:
|
|
1155
|
-
max-height:
|
|
1155
|
+
min-height: ${barH}px !important;
|
|
1156
|
+
height: ${barH}px !important;
|
|
1157
|
+
max-height: ${barH}px !important;
|
|
1156
1158
|
width: 100% !important;
|
|
1157
1159
|
min-width: 100% !important;
|
|
1158
1160
|
max-width: 100% !important;
|
|
@@ -1161,11 +1163,11 @@ var Wrapper = styled.div`
|
|
|
1161
1163
|
}
|
|
1162
1164
|
` : css`
|
|
1163
1165
|
/* Overlay mode: translate up to show only toggle button - based on commit 8379cc8 */
|
|
1164
|
-
transform: translateY(calc(-100% +
|
|
1166
|
+
transform: translateY(calc(-100% + ${barH}px));
|
|
1165
1167
|
`}
|
|
1166
1168
|
` : css`
|
|
1167
1169
|
/* Bottom position: translate down to show only toggle button */
|
|
1168
|
-
transform: translateY(calc(100% -
|
|
1170
|
+
transform: translateY(calc(100% - ${barH}px));
|
|
1169
1171
|
width: 100%;
|
|
1170
1172
|
|
|
1171
1173
|
${screens.tablet} {
|
|
@@ -1180,11 +1182,12 @@ var Wrapper = styled.div`
|
|
|
1180
1182
|
|
|
1181
1183
|
> *:last-child {
|
|
1182
1184
|
flex-shrink: 0;
|
|
1183
|
-
min-height:
|
|
1184
|
-
height:
|
|
1185
|
+
min-height: ${barH}px;
|
|
1186
|
+
height: ${barH}px;
|
|
1185
1187
|
width: 100%;
|
|
1186
1188
|
}
|
|
1187
|
-
`)
|
|
1189
|
+
`);
|
|
1190
|
+
}}
|
|
1188
1191
|
|
|
1189
1192
|
/* Opened state styles when pushContentDown is true - must come after closed state */
|
|
1190
1193
|
/* Chat overlays (Bar is fixed); same internal layout as overlay — no display overrides */
|
|
@@ -2530,9 +2533,9 @@ var ChatbotFooter_default = ChatbotFooter;
|
|
|
2530
2533
|
import { screens as screens2 } from "@ibti-tech/ui";
|
|
2531
2534
|
import { css as css4, styled as styled9 } from "styled-components";
|
|
2532
2535
|
var ButtonWrapper = styled9.button`
|
|
2533
|
-
height:
|
|
2534
|
-
min-height:
|
|
2535
|
-
max-height:
|
|
2536
|
+
height: ${(p) => p.$barHeight ?? 32}px !important;
|
|
2537
|
+
min-height: ${(p) => p.$barHeight ?? 32}px !important;
|
|
2538
|
+
max-height: ${(p) => p.$barHeight ?? 32}px !important;
|
|
2536
2539
|
width: 100% !important;
|
|
2537
2540
|
min-width: 100% !important;
|
|
2538
2541
|
max-width: 100% !important;
|
|
@@ -2561,8 +2564,8 @@ var ButtonWrapper = styled9.button`
|
|
|
2561
2564
|
${(props) => !props.$opened && props.$verticalPosition === "bottom" && css4`
|
|
2562
2565
|
background-color: ${props.theme.colors.layers[1].background};
|
|
2563
2566
|
cursor: pointer;
|
|
2564
|
-
min-height:
|
|
2565
|
-
height:
|
|
2567
|
+
min-height: ${props.$barHeight ?? 32}px;
|
|
2568
|
+
height: ${props.$barHeight ?? 32}px;
|
|
2566
2569
|
width: 100%;
|
|
2567
2570
|
flex-shrink: 0;
|
|
2568
2571
|
box-sizing: border-box;
|
|
@@ -2595,10 +2598,12 @@ var ButtonWrapper = styled9.button`
|
|
|
2595
2598
|
// src/components/ChatbotToggle/index.tsx
|
|
2596
2599
|
import React12 from "react";
|
|
2597
2600
|
import { ChevronDownIcon, ChevronUpIcon } from "@ibti-tech/ui/dist/icons";
|
|
2601
|
+
var DEFAULT_BAR_HEIGHT = 32;
|
|
2598
2602
|
var ChatbotToggle = /* @__PURE__ */ __name(({
|
|
2599
2603
|
verticalPosition = "bottom",
|
|
2600
2604
|
opened: openedProp,
|
|
2601
|
-
pushContentDown = false
|
|
2605
|
+
pushContentDown = false,
|
|
2606
|
+
pushContentDownBarHeight = DEFAULT_BAR_HEIGHT
|
|
2602
2607
|
}) => {
|
|
2603
2608
|
const { opened: openedContext, openedToggle, theme: themeMode } = useChatbot_default();
|
|
2604
2609
|
const opened = openedProp ?? openedContext;
|
|
@@ -2612,7 +2617,8 @@ var ChatbotToggle = /* @__PURE__ */ __name(({
|
|
|
2612
2617
|
$opened: opened,
|
|
2613
2618
|
$verticalPosition: verticalPosition,
|
|
2614
2619
|
$pushContentDown: pushContentDown,
|
|
2615
|
-
$themeMode: themeMode
|
|
2620
|
+
$themeMode: themeMode,
|
|
2621
|
+
$barHeight: pushContentDownBarHeight
|
|
2616
2622
|
},
|
|
2617
2623
|
/* @__PURE__ */ React12.createElement(BotIcon, null),
|
|
2618
2624
|
/* @__PURE__ */ React12.createElement("span", null, toggleText),
|
|
@@ -2807,7 +2813,7 @@ var ChatUserFeedbackRating = /* @__PURE__ */ __name(({
|
|
|
2807
2813
|
// src/contexts/Chatbot/useChatFeedbackBox.ts
|
|
2808
2814
|
import { useState as useState9 } from "react";
|
|
2809
2815
|
var useChatFeedbackBox = /* @__PURE__ */ __name(() => {
|
|
2810
|
-
const {
|
|
2816
|
+
const { apiURL, locale, publicHash, visitorId } = useChatbot_default();
|
|
2811
2817
|
const [rated, setRated] = useState9(false);
|
|
2812
2818
|
const [opened, setOpened] = useState9(false);
|
|
2813
2819
|
const [loading, setLoading] = useState9(false);
|
|
@@ -2828,10 +2834,6 @@ var useChatFeedbackBox = /* @__PURE__ */ __name(() => {
|
|
|
2828
2834
|
apiURL,
|
|
2829
2835
|
publicHash,
|
|
2830
2836
|
visitorId,
|
|
2831
|
-
chatContext: chatMessages.map((item) => ({
|
|
2832
|
-
role: item.role,
|
|
2833
|
-
content: item.content
|
|
2834
|
-
})),
|
|
2835
2837
|
locale,
|
|
2836
2838
|
ratingScore,
|
|
2837
2839
|
description
|
|
@@ -2852,20 +2854,24 @@ var useChatFeedbackBox = /* @__PURE__ */ __name(() => {
|
|
|
2852
2854
|
}, "useChatFeedbackBox");
|
|
2853
2855
|
|
|
2854
2856
|
// src/components/ChatbotDevice/index.tsx
|
|
2857
|
+
var DEFAULT_PUSH_DOWN_BAR_HEIGHT = 32;
|
|
2855
2858
|
var ChatbotDevice = /* @__PURE__ */ __name(({
|
|
2856
2859
|
verticalPosition = "bottom",
|
|
2857
2860
|
pushContentDown = false,
|
|
2858
|
-
horizontalPosition
|
|
2861
|
+
horizontalPosition,
|
|
2862
|
+
pushContentDownBarHeight = DEFAULT_PUSH_DOWN_BAR_HEIGHT
|
|
2859
2863
|
}) => {
|
|
2860
2864
|
const { opened } = useChatbot_default();
|
|
2861
2865
|
const chatFeedbackBox = useChatFeedbackBox();
|
|
2866
|
+
const barH = pushContentDownBarHeight;
|
|
2862
2867
|
return /* @__PURE__ */ React14.createElement(
|
|
2863
2868
|
Wrapper,
|
|
2864
2869
|
{
|
|
2865
2870
|
$opened: opened,
|
|
2866
2871
|
$verticalPosition: verticalPosition,
|
|
2867
2872
|
$pushContentDown: pushContentDown,
|
|
2868
|
-
$horizontalPosition: horizontalPosition
|
|
2873
|
+
$horizontalPosition: horizontalPosition,
|
|
2874
|
+
$pushContentDownBarHeight: barH
|
|
2869
2875
|
},
|
|
2870
2876
|
/* @__PURE__ */ React14.createElement(ChatUserFeedbackRating, { chatFeedbackBox }),
|
|
2871
2877
|
/* @__PURE__ */ React14.createElement(ChatbotHeader_default, { chatFeedbackBox }),
|
|
@@ -2876,7 +2882,8 @@ var ChatbotDevice = /* @__PURE__ */ __name(({
|
|
|
2876
2882
|
{
|
|
2877
2883
|
verticalPosition,
|
|
2878
2884
|
opened,
|
|
2879
|
-
pushContentDown
|
|
2885
|
+
pushContentDown,
|
|
2886
|
+
pushContentDownBarHeight: barH
|
|
2880
2887
|
}
|
|
2881
2888
|
)
|
|
2882
2889
|
);
|
|
@@ -2954,20 +2961,22 @@ var PushDownRow = styled11.div`
|
|
|
2954
2961
|
position: absolute;
|
|
2955
2962
|
inset: 0;
|
|
2956
2963
|
width: 100%;
|
|
2957
|
-
height:
|
|
2958
|
-
min-height:
|
|
2964
|
+
height: ${(p) => p.$barHeight}px;
|
|
2965
|
+
min-height: ${(p) => p.$barHeight}px;
|
|
2959
2966
|
background-color: ${(p) => p.$background};
|
|
2960
2967
|
z-index: 0;
|
|
2961
2968
|
pointer-events: none;
|
|
2962
2969
|
`;
|
|
2963
2970
|
var Wrapper10 = styled11.div`
|
|
2964
2971
|
${(props) => {
|
|
2972
|
+
const barH = props.$pushContentDownBarHeight ?? 32;
|
|
2973
|
+
const topVal = props.$topOffset !== void 0 ? typeof props.$topOffset === "number" ? `${props.$topOffset}px` : props.$topOffset : "0";
|
|
2965
2974
|
if (props.$pushContentDown && props.$verticalPosition === "top") {
|
|
2966
2975
|
if (props.$opened) {
|
|
2967
2976
|
return css6`
|
|
2968
2977
|
position: fixed !important;
|
|
2969
2978
|
width: 100%;
|
|
2970
|
-
top:
|
|
2979
|
+
top: ${topVal} !important;
|
|
2971
2980
|
bottom: auto !important;
|
|
2972
2981
|
left: 0 !important;
|
|
2973
2982
|
right: 0 !important;
|
|
@@ -2982,13 +2991,13 @@ var Wrapper10 = styled11.div`
|
|
|
2982
2991
|
background-color: transparent;
|
|
2983
2992
|
border: none;
|
|
2984
2993
|
padding: 0;
|
|
2985
|
-
top: ${
|
|
2994
|
+
top: ${topVal} !important;
|
|
2986
2995
|
bottom: auto !important;
|
|
2987
2996
|
${props.$horizontalPosition === "right" ? css6`left: auto !important; right: 2.5rem !important;` : css6`left: 2.5rem !important; right: auto !important;`}
|
|
2988
2997
|
}
|
|
2989
2998
|
@media screen and (max-width: ${breakpoints3.tablet}px) {
|
|
2990
2999
|
padding-top: 0 !important;
|
|
2991
|
-
top:
|
|
3000
|
+
top: ${topVal} !important;
|
|
2992
3001
|
height: 100vh;
|
|
2993
3002
|
}
|
|
2994
3003
|
`;
|
|
@@ -2996,14 +3005,14 @@ var Wrapper10 = styled11.div`
|
|
|
2996
3005
|
return css6`
|
|
2997
3006
|
position: fixed !important;
|
|
2998
3007
|
width: 100%;
|
|
2999
|
-
top:
|
|
3008
|
+
top: ${topVal} !important;
|
|
3000
3009
|
bottom: auto !important;
|
|
3001
3010
|
left: 0 !important;
|
|
3002
3011
|
right: 0 !important;
|
|
3003
3012
|
z-index: ${props.$zIndex !== void 0 ? props.$zIndex : props.theme.zIndex.modals};
|
|
3004
3013
|
pointer-events: auto;
|
|
3005
|
-
height:
|
|
3006
|
-
min-height:
|
|
3014
|
+
height: ${barH}px !important;
|
|
3015
|
+
min-height: ${barH}px !important;
|
|
3007
3016
|
background-color: transparent;
|
|
3008
3017
|
${screens3.tablet} {
|
|
3009
3018
|
width: 100% !important;
|
|
@@ -3011,10 +3020,12 @@ var Wrapper10 = styled11.div`
|
|
|
3011
3020
|
border: none;
|
|
3012
3021
|
padding: 0;
|
|
3013
3022
|
bottom: auto !important;
|
|
3023
|
+
top: ${topVal} !important;
|
|
3014
3024
|
}
|
|
3015
3025
|
@media screen and (max-width: ${breakpoints3.tablet}px) {
|
|
3016
|
-
height:
|
|
3017
|
-
min-height:
|
|
3026
|
+
height: ${barH}px !important;
|
|
3027
|
+
min-height: ${barH}px !important;
|
|
3028
|
+
top: ${topVal} !important;
|
|
3018
3029
|
}
|
|
3019
3030
|
`;
|
|
3020
3031
|
}
|
|
@@ -3063,6 +3074,9 @@ import React15, { useEffect as useEffect8, useState as useState10 } from "react"
|
|
|
3063
3074
|
import { createPortal } from "react-dom";
|
|
3064
3075
|
var PUSH_DOWN_ROW_BG_LIGHT = "rgb(230, 230, 230)";
|
|
3065
3076
|
var PUSH_DOWN_ROW_BG_DARK = "rgb(0, 0, 0)";
|
|
3077
|
+
var PUSH_DOWN_BAR_HEIGHT_PX = 32;
|
|
3078
|
+
var BODY_CLASS_PUSH_DOWN = "ibti-chatbot-push-down";
|
|
3079
|
+
var BODY_CSS_VAR_BAR_HEIGHT = "--ibti-chatbot-bar-height";
|
|
3066
3080
|
var ChatbotBar = /* @__PURE__ */ __name(({
|
|
3067
3081
|
verticalPosition = "bottom",
|
|
3068
3082
|
horizontalPosition = "right",
|
|
@@ -3072,8 +3086,10 @@ var ChatbotBar = /* @__PURE__ */ __name(({
|
|
|
3072
3086
|
aboveHeader = false,
|
|
3073
3087
|
pushContentDown = false,
|
|
3074
3088
|
pushContentDownRowBackgroundLight = PUSH_DOWN_ROW_BG_LIGHT,
|
|
3075
|
-
pushContentDownRowBackgroundDark = PUSH_DOWN_ROW_BG_DARK
|
|
3089
|
+
pushContentDownRowBackgroundDark = PUSH_DOWN_ROW_BG_DARK,
|
|
3090
|
+
pushContentDownBarHeight = PUSH_DOWN_BAR_HEIGHT_PX
|
|
3076
3091
|
}) => {
|
|
3092
|
+
const barHeightPx = Math.max(24, Math.min(120, pushContentDownBarHeight));
|
|
3077
3093
|
const { opened, theme } = useChatbot_default();
|
|
3078
3094
|
const pushDownRowBackground = theme === "dark" ? pushContentDownRowBackgroundDark : pushContentDownRowBackgroundLight;
|
|
3079
3095
|
const [portalContainer, setPortalContainer] = useState10(null);
|
|
@@ -3101,18 +3117,17 @@ var ChatbotBar = /* @__PURE__ */ __name(({
|
|
|
3101
3117
|
}
|
|
3102
3118
|
}, [verticalPosition]);
|
|
3103
3119
|
const usePushDown = pushContentDown && verticalPosition === "top";
|
|
3104
|
-
|
|
3105
|
-
"
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
), /* @__PURE__ */ React15.createElement(
|
|
3120
|
+
useEffect8(() => {
|
|
3121
|
+
if (!usePushDown || typeof document === "undefined") return;
|
|
3122
|
+
const body = document.body;
|
|
3123
|
+
body.classList.add(BODY_CLASS_PUSH_DOWN);
|
|
3124
|
+
body.style.setProperty(BODY_CSS_VAR_BAR_HEIGHT, `${barHeightPx}px`);
|
|
3125
|
+
return () => {
|
|
3126
|
+
body.classList.remove(BODY_CLASS_PUSH_DOWN);
|
|
3127
|
+
body.style.removeProperty(BODY_CSS_VAR_BAR_HEIGHT);
|
|
3128
|
+
};
|
|
3129
|
+
}, [usePushDown, barHeightPx]);
|
|
3130
|
+
const content = /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
3116
3131
|
Wrapper10,
|
|
3117
3132
|
{
|
|
3118
3133
|
$verticalPosition: verticalPosition,
|
|
@@ -3121,9 +3136,17 @@ var ChatbotBar = /* @__PURE__ */ __name(({
|
|
|
3121
3136
|
$zIndex: calculatedZIndex,
|
|
3122
3137
|
$topOffset: topOffset,
|
|
3123
3138
|
$aboveHeader: aboveHeader,
|
|
3124
|
-
$pushContentDown: pushContentDown
|
|
3139
|
+
$pushContentDown: pushContentDown,
|
|
3140
|
+
$pushContentDownBarHeight: barHeightPx
|
|
3125
3141
|
},
|
|
3126
|
-
usePushDown && !opened && /* @__PURE__ */ React15.createElement(
|
|
3142
|
+
usePushDown && !opened && /* @__PURE__ */ React15.createElement(
|
|
3143
|
+
PushDownRow,
|
|
3144
|
+
{
|
|
3145
|
+
$background: pushDownRowBackground,
|
|
3146
|
+
$barHeight: barHeightPx,
|
|
3147
|
+
"aria-hidden": true
|
|
3148
|
+
}
|
|
3149
|
+
),
|
|
3127
3150
|
/* @__PURE__ */ React15.createElement(
|
|
3128
3151
|
BarContainer,
|
|
3129
3152
|
{
|
|
@@ -3138,7 +3161,8 @@ var ChatbotBar = /* @__PURE__ */ __name(({
|
|
|
3138
3161
|
{
|
|
3139
3162
|
verticalPosition,
|
|
3140
3163
|
pushContentDown: usePushDown,
|
|
3141
|
-
horizontalPosition: deviceHorizontalPosition
|
|
3164
|
+
horizontalPosition: deviceHorizontalPosition,
|
|
3165
|
+
pushContentDownBarHeight: barHeightPx
|
|
3142
3166
|
}
|
|
3143
3167
|
)
|
|
3144
3168
|
)
|